ent

package
v0.0.0-...-61914f4 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

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

	// Node types.
	TypeAttachment = "Attachment"
	TypePatient    = "Patient"
	TypeReception  = "Reception"
	TypeVisit      = "Visit"
)

Variables

This section is empty.

Functions

func Asc

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

Asc applies the given fields in ASC order.

func Desc

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

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Attachment

type Attachment struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// FilePath holds the value of the "file_path" field.
	FilePath string `json:"file_path,omitempty"`
	// FileType holds the value of the "file_type" field.
	FileType string `json:"file_type,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt time.Time `json:"deleted_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the AttachmentQuery when eager-loading is set.
	Edges AttachmentEdges `json:"edges"`
	// contains filtered or unexported fields
}

Attachment is the model entity for the Attachment schema.

func (*Attachment) QueryPatient

func (a *Attachment) QueryPatient() *PatientQuery

QueryPatient queries the "patient" edge of the Attachment entity.

func (*Attachment) QueryVisit

func (a *Attachment) QueryVisit() *VisitQuery

QueryVisit queries the "visit" edge of the Attachment entity.

func (*Attachment) String

func (a *Attachment) String() string

String implements the fmt.Stringer.

func (*Attachment) Unwrap

func (a *Attachment) Unwrap() *Attachment

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

func (a *Attachment) Update() *AttachmentUpdateOne

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

func (*Attachment) Value

func (a *Attachment) Value(name string) (ent.Value, error)

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

type AttachmentClient

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

AttachmentClient is a client for the Attachment schema.

func NewAttachmentClient

func NewAttachmentClient(c config) *AttachmentClient

NewAttachmentClient returns a client for the Attachment from the given config.

func (*AttachmentClient) Create

func (c *AttachmentClient) Create() *AttachmentCreate

Create returns a builder for creating a Attachment entity.

func (*AttachmentClient) CreateBulk

func (c *AttachmentClient) CreateBulk(builders ...*AttachmentCreate) *AttachmentCreateBulk

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

func (*AttachmentClient) Delete

func (c *AttachmentClient) Delete() *AttachmentDelete

Delete returns a delete builder for Attachment.

func (*AttachmentClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*AttachmentClient) DeleteOneID

func (c *AttachmentClient) DeleteOneID(id int) *AttachmentDeleteOne

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

func (*AttachmentClient) Get

func (c *AttachmentClient) Get(ctx context.Context, id int) (*Attachment, error)

Get returns a Attachment entity by its id.

func (*AttachmentClient) GetX

func (c *AttachmentClient) GetX(ctx context.Context, id int) *Attachment

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

func (*AttachmentClient) Hooks

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

Hooks returns the client hooks.

func (*AttachmentClient) Intercept

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

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

func (*AttachmentClient) Interceptors

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

Interceptors returns the client interceptors.

func (*AttachmentClient) Query

func (c *AttachmentClient) Query() *AttachmentQuery

Query returns a query builder for Attachment.

func (*AttachmentClient) QueryPatient

func (c *AttachmentClient) QueryPatient(a *Attachment) *PatientQuery

QueryPatient queries the patient edge of a Attachment.

func (*AttachmentClient) QueryVisit

func (c *AttachmentClient) QueryVisit(a *Attachment) *VisitQuery

QueryVisit queries the visit edge of a Attachment.

func (*AttachmentClient) Update

func (c *AttachmentClient) Update() *AttachmentUpdate

Update returns an update builder for Attachment.

func (*AttachmentClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*AttachmentClient) UpdateOneID

func (c *AttachmentClient) UpdateOneID(id int) *AttachmentUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AttachmentClient) Use

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

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

type AttachmentCreate

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

AttachmentCreate is the builder for creating a Attachment entity.

func (*AttachmentCreate) Exec

func (ac *AttachmentCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*AttachmentCreate) ExecX

func (ac *AttachmentCreate) ExecX(ctx context.Context)

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

func (*AttachmentCreate) Mutation

func (ac *AttachmentCreate) Mutation() *AttachmentMutation

Mutation returns the AttachmentMutation object of the builder.

func (*AttachmentCreate) Save

func (ac *AttachmentCreate) Save(ctx context.Context) (*Attachment, error)

Save creates the Attachment in the database.

func (*AttachmentCreate) SaveX

func (ac *AttachmentCreate) SaveX(ctx context.Context) *Attachment

SaveX calls Save and panics if Save returns an error.

func (*AttachmentCreate) SetCreatedAt

func (ac *AttachmentCreate) SetCreatedAt(t time.Time) *AttachmentCreate

SetCreatedAt sets the "created_at" field.

func (*AttachmentCreate) SetDeletedAt

func (ac *AttachmentCreate) SetDeletedAt(t time.Time) *AttachmentCreate

SetDeletedAt sets the "deleted_at" field.

func (*AttachmentCreate) SetFilePath

func (ac *AttachmentCreate) SetFilePath(s string) *AttachmentCreate

SetFilePath sets the "file_path" field.

func (*AttachmentCreate) SetFileType

func (ac *AttachmentCreate) SetFileType(s string) *AttachmentCreate

SetFileType sets the "file_type" field.

func (*AttachmentCreate) SetNillableCreatedAt

func (ac *AttachmentCreate) SetNillableCreatedAt(t *time.Time) *AttachmentCreate

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

func (*AttachmentCreate) SetNillableDeletedAt

func (ac *AttachmentCreate) SetNillableDeletedAt(t *time.Time) *AttachmentCreate

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

func (*AttachmentCreate) SetNillableFilePath

func (ac *AttachmentCreate) SetNillableFilePath(s *string) *AttachmentCreate

SetNillableFilePath sets the "file_path" field if the given value is not nil.

func (*AttachmentCreate) SetNillableFileType

func (ac *AttachmentCreate) SetNillableFileType(s *string) *AttachmentCreate

SetNillableFileType sets the "file_type" field if the given value is not nil.

func (*AttachmentCreate) SetNillablePatientID

func (ac *AttachmentCreate) SetNillablePatientID(id *int) *AttachmentCreate

SetNillablePatientID sets the "patient" edge to the Patient entity by ID if the given value is not nil.

func (*AttachmentCreate) SetNillableUpdatedAt

func (ac *AttachmentCreate) SetNillableUpdatedAt(t *time.Time) *AttachmentCreate

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

func (*AttachmentCreate) SetNillableVisitID

func (ac *AttachmentCreate) SetNillableVisitID(id *int) *AttachmentCreate

SetNillableVisitID sets the "visit" edge to the Visit entity by ID if the given value is not nil.

func (*AttachmentCreate) SetPatient

func (ac *AttachmentCreate) SetPatient(p *Patient) *AttachmentCreate

SetPatient sets the "patient" edge to the Patient entity.

func (*AttachmentCreate) SetPatientID

func (ac *AttachmentCreate) SetPatientID(id int) *AttachmentCreate

SetPatientID sets the "patient" edge to the Patient entity by ID.

func (*AttachmentCreate) SetUpdatedAt

func (ac *AttachmentCreate) SetUpdatedAt(t time.Time) *AttachmentCreate

SetUpdatedAt sets the "updated_at" field.

func (*AttachmentCreate) SetVisit

func (ac *AttachmentCreate) SetVisit(v *Visit) *AttachmentCreate

SetVisit sets the "visit" edge to the Visit entity.

func (*AttachmentCreate) SetVisitID

func (ac *AttachmentCreate) SetVisitID(id int) *AttachmentCreate

SetVisitID sets the "visit" edge to the Visit entity by ID.

type AttachmentCreateBulk

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

AttachmentCreateBulk is the builder for creating many Attachment entities in bulk.

func (*AttachmentCreateBulk) Exec

func (acb *AttachmentCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*AttachmentCreateBulk) ExecX

func (acb *AttachmentCreateBulk) ExecX(ctx context.Context)

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

func (*AttachmentCreateBulk) Save

func (acb *AttachmentCreateBulk) Save(ctx context.Context) ([]*Attachment, error)

Save creates the Attachment entities in the database.

func (*AttachmentCreateBulk) SaveX

func (acb *AttachmentCreateBulk) SaveX(ctx context.Context) []*Attachment

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

type AttachmentDelete

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

AttachmentDelete is the builder for deleting a Attachment entity.

func (*AttachmentDelete) Exec

func (ad *AttachmentDelete) Exec(ctx context.Context) (int, error)

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

func (*AttachmentDelete) ExecX

func (ad *AttachmentDelete) ExecX(ctx context.Context) int

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

func (*AttachmentDelete) Where

Where appends a list predicates to the AttachmentDelete builder.

type AttachmentDeleteOne

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

AttachmentDeleteOne is the builder for deleting a single Attachment entity.

func (*AttachmentDeleteOne) Exec

func (ado *AttachmentDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*AttachmentDeleteOne) ExecX

func (ado *AttachmentDeleteOne) ExecX(ctx context.Context)

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

func (*AttachmentDeleteOne) Where

Where appends a list predicates to the AttachmentDelete builder.

type AttachmentEdges

type AttachmentEdges struct {
	// Visit holds the value of the visit edge.
	Visit *Visit `json:"visit,omitempty"`
	// Patient holds the value of the patient edge.
	Patient *Patient `json:"patient,omitempty"`
	// contains filtered or unexported fields
}

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

func (AttachmentEdges) PatientOrErr

func (e AttachmentEdges) PatientOrErr() (*Patient, error)

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

func (AttachmentEdges) VisitOrErr

func (e AttachmentEdges) VisitOrErr() (*Visit, error)

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

type AttachmentGroupBy

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

AttachmentGroupBy is the group-by builder for Attachment entities.

func (*AttachmentGroupBy) Aggregate

func (agb *AttachmentGroupBy) Aggregate(fns ...AggregateFunc) *AttachmentGroupBy

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

func (*AttachmentGroupBy) Bool

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

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

func (*AttachmentGroupBy) BoolX

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

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

func (*AttachmentGroupBy) Bools

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

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

func (*AttachmentGroupBy) BoolsX

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

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

func (*AttachmentGroupBy) Float64

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

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

func (*AttachmentGroupBy) Float64X

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

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

func (*AttachmentGroupBy) Float64s

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

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

func (*AttachmentGroupBy) Float64sX

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

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

func (*AttachmentGroupBy) Int

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

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

func (*AttachmentGroupBy) IntX

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

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

func (*AttachmentGroupBy) Ints

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

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

func (*AttachmentGroupBy) IntsX

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

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

func (*AttachmentGroupBy) Scan

func (agb *AttachmentGroupBy) Scan(ctx context.Context, v any) error

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

func (*AttachmentGroupBy) ScanX

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

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

func (*AttachmentGroupBy) String

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

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

func (*AttachmentGroupBy) StringX

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

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

func (*AttachmentGroupBy) Strings

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

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

func (*AttachmentGroupBy) StringsX

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

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

type AttachmentMutation

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

AttachmentMutation represents an operation that mutates the Attachment nodes in the graph.

func (*AttachmentMutation) AddField

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

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

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

func (*AttachmentMutation) AddedField

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

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

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

func (*AttachmentMutation) AddedIDs

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

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

func (*AttachmentMutation) ClearDeletedAt

func (m *AttachmentMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*AttachmentMutation) ClearEdge

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

func (m *AttachmentMutation) 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 (*AttachmentMutation) ClearFilePath

func (m *AttachmentMutation) ClearFilePath()

ClearFilePath clears the value of the "file_path" field.

func (*AttachmentMutation) ClearFileType

func (m *AttachmentMutation) ClearFileType()

ClearFileType clears the value of the "file_type" field.

func (*AttachmentMutation) ClearPatient

func (m *AttachmentMutation) ClearPatient()

ClearPatient clears the "patient" edge to the Patient entity.

func (*AttachmentMutation) ClearUpdatedAt

func (m *AttachmentMutation) ClearUpdatedAt()

ClearUpdatedAt clears the value of the "updated_at" field.

func (*AttachmentMutation) ClearVisit

func (m *AttachmentMutation) ClearVisit()

ClearVisit clears the "visit" edge to the Visit entity.

func (*AttachmentMutation) ClearedEdges

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

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

func (*AttachmentMutation) ClearedFields

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

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

func (AttachmentMutation) Client

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

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

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

func (*AttachmentMutation) DeletedAt

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

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

func (*AttachmentMutation) DeletedAtCleared

func (m *AttachmentMutation) DeletedAtCleared() bool

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

func (*AttachmentMutation) EdgeCleared

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

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

func (*AttachmentMutation) Field

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

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

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

func (*AttachmentMutation) Fields

func (m *AttachmentMutation) 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 (*AttachmentMutation) FilePath

func (m *AttachmentMutation) FilePath() (r string, exists bool)

FilePath returns the value of the "file_path" field in the mutation.

func (*AttachmentMutation) FilePathCleared

func (m *AttachmentMutation) FilePathCleared() bool

FilePathCleared returns if the "file_path" field was cleared in this mutation.

func (*AttachmentMutation) FileType

func (m *AttachmentMutation) FileType() (r string, exists bool)

FileType returns the value of the "file_type" field in the mutation.

func (*AttachmentMutation) FileTypeCleared

func (m *AttachmentMutation) FileTypeCleared() bool

FileTypeCleared returns if the "file_type" field was cleared in this mutation.

func (*AttachmentMutation) ID

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

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

func (*AttachmentMutation) IDs

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

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

func (*AttachmentMutation) OldCreatedAt

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

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

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

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

func (m *AttachmentMutation) 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 (*AttachmentMutation) OldFilePath

func (m *AttachmentMutation) OldFilePath(ctx context.Context) (v string, err error)

OldFilePath returns the old "file_path" field's value of the Attachment entity. If the Attachment 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 (*AttachmentMutation) OldFileType

func (m *AttachmentMutation) OldFileType(ctx context.Context) (v string, err error)

OldFileType returns the old "file_type" field's value of the Attachment entity. If the Attachment 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 (*AttachmentMutation) OldUpdatedAt

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

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

func (m *AttachmentMutation) Op() Op

Op returns the operation name.

func (*AttachmentMutation) PatientCleared

func (m *AttachmentMutation) PatientCleared() bool

PatientCleared reports if the "patient" edge to the Patient entity was cleared.

func (*AttachmentMutation) PatientID

func (m *AttachmentMutation) PatientID() (id int, exists bool)

PatientID returns the "patient" edge ID in the mutation.

func (*AttachmentMutation) PatientIDs

func (m *AttachmentMutation) PatientIDs() (ids []int)

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

func (*AttachmentMutation) RemovedEdges

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

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

func (*AttachmentMutation) RemovedIDs

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

func (m *AttachmentMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*AttachmentMutation) ResetDeletedAt

func (m *AttachmentMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*AttachmentMutation) ResetEdge

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

func (m *AttachmentMutation) 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 (*AttachmentMutation) ResetFilePath

func (m *AttachmentMutation) ResetFilePath()

ResetFilePath resets all changes to the "file_path" field.

func (*AttachmentMutation) ResetFileType

func (m *AttachmentMutation) ResetFileType()

ResetFileType resets all changes to the "file_type" field.

func (*AttachmentMutation) ResetPatient

func (m *AttachmentMutation) ResetPatient()

ResetPatient resets all changes to the "patient" edge.

func (*AttachmentMutation) ResetUpdatedAt

func (m *AttachmentMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*AttachmentMutation) ResetVisit

func (m *AttachmentMutation) ResetVisit()

ResetVisit resets all changes to the "visit" edge.

func (*AttachmentMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*AttachmentMutation) SetDeletedAt

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

SetDeletedAt sets the "deleted_at" field.

func (*AttachmentMutation) SetField

func (m *AttachmentMutation) 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 (*AttachmentMutation) SetFilePath

func (m *AttachmentMutation) SetFilePath(s string)

SetFilePath sets the "file_path" field.

func (*AttachmentMutation) SetFileType

func (m *AttachmentMutation) SetFileType(s string)

SetFileType sets the "file_type" field.

func (*AttachmentMutation) SetOp

func (m *AttachmentMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*AttachmentMutation) SetPatientID

func (m *AttachmentMutation) SetPatientID(id int)

SetPatientID sets the "patient" edge to the Patient entity by id.

func (*AttachmentMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*AttachmentMutation) SetVisitID

func (m *AttachmentMutation) SetVisitID(id int)

SetVisitID sets the "visit" edge to the Visit entity by id.

func (AttachmentMutation) Tx

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

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

func (*AttachmentMutation) Type

func (m *AttachmentMutation) Type() string

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

func (*AttachmentMutation) UpdatedAt

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

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

func (*AttachmentMutation) UpdatedAtCleared

func (m *AttachmentMutation) UpdatedAtCleared() bool

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

func (*AttachmentMutation) VisitCleared

func (m *AttachmentMutation) VisitCleared() bool

VisitCleared reports if the "visit" edge to the Visit entity was cleared.

func (*AttachmentMutation) VisitID

func (m *AttachmentMutation) VisitID() (id int, exists bool)

VisitID returns the "visit" edge ID in the mutation.

func (*AttachmentMutation) VisitIDs

func (m *AttachmentMutation) VisitIDs() (ids []int)

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

func (*AttachmentMutation) Where

func (m *AttachmentMutation) Where(ps ...predicate.Attachment)

Where appends a list predicates to the AttachmentMutation builder.

func (*AttachmentMutation) WhereP

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

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

type AttachmentQuery

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

AttachmentQuery is the builder for querying Attachment entities.

func (*AttachmentQuery) Aggregate

func (aq *AttachmentQuery) Aggregate(fns ...AggregateFunc) *AttachmentSelect

Aggregate returns a AttachmentSelect configured with the given aggregations.

func (*AttachmentQuery) All

func (aq *AttachmentQuery) All(ctx context.Context) ([]*Attachment, error)

All executes the query and returns a list of Attachments.

func (*AttachmentQuery) AllX

func (aq *AttachmentQuery) AllX(ctx context.Context) []*Attachment

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

func (*AttachmentQuery) Clone

func (aq *AttachmentQuery) Clone() *AttachmentQuery

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

func (*AttachmentQuery) Count

func (aq *AttachmentQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*AttachmentQuery) CountX

func (aq *AttachmentQuery) CountX(ctx context.Context) int

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

func (*AttachmentQuery) Exist

func (aq *AttachmentQuery) Exist(ctx context.Context) (bool, error)

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

func (*AttachmentQuery) ExistX

func (aq *AttachmentQuery) ExistX(ctx context.Context) bool

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

func (*AttachmentQuery) First

func (aq *AttachmentQuery) First(ctx context.Context) (*Attachment, error)

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

func (*AttachmentQuery) FirstID

func (aq *AttachmentQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*AttachmentQuery) FirstIDX

func (aq *AttachmentQuery) FirstIDX(ctx context.Context) int

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

func (*AttachmentQuery) FirstX

func (aq *AttachmentQuery) FirstX(ctx context.Context) *Attachment

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

func (*AttachmentQuery) GroupBy

func (aq *AttachmentQuery) GroupBy(field string, fields ...string) *AttachmentGroupBy

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

client.Attachment.Query().
	GroupBy(attachment.FieldFilePath).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*AttachmentQuery) IDs

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

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

func (*AttachmentQuery) IDsX

func (aq *AttachmentQuery) IDsX(ctx context.Context) []int

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

func (*AttachmentQuery) Limit

func (aq *AttachmentQuery) Limit(limit int) *AttachmentQuery

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

func (*AttachmentQuery) Offset

func (aq *AttachmentQuery) Offset(offset int) *AttachmentQuery

Offset to start from.

func (*AttachmentQuery) Only

func (aq *AttachmentQuery) Only(ctx context.Context) (*Attachment, error)

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

func (*AttachmentQuery) OnlyID

func (aq *AttachmentQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*AttachmentQuery) OnlyIDX

func (aq *AttachmentQuery) OnlyIDX(ctx context.Context) int

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

func (*AttachmentQuery) OnlyX

func (aq *AttachmentQuery) OnlyX(ctx context.Context) *Attachment

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

func (*AttachmentQuery) Order

Order specifies how the records should be ordered.

func (*AttachmentQuery) QueryPatient

func (aq *AttachmentQuery) QueryPatient() *PatientQuery

QueryPatient chains the current query on the "patient" edge.

func (*AttachmentQuery) QueryVisit

func (aq *AttachmentQuery) QueryVisit() *VisitQuery

QueryVisit chains the current query on the "visit" edge.

func (*AttachmentQuery) Select

func (aq *AttachmentQuery) Select(fields ...string) *AttachmentSelect

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

client.Attachment.Query().
	Select(attachment.FieldFilePath).
	Scan(ctx, &v)

func (*AttachmentQuery) Unique

func (aq *AttachmentQuery) Unique(unique bool) *AttachmentQuery

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

Where adds a new predicate for the AttachmentQuery builder.

func (*AttachmentQuery) WithPatient

func (aq *AttachmentQuery) WithPatient(opts ...func(*PatientQuery)) *AttachmentQuery

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

func (*AttachmentQuery) WithVisit

func (aq *AttachmentQuery) WithVisit(opts ...func(*VisitQuery)) *AttachmentQuery

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

type AttachmentSelect

type AttachmentSelect struct {
	*AttachmentQuery
	// contains filtered or unexported fields
}

AttachmentSelect is the builder for selecting fields of Attachment entities.

func (*AttachmentSelect) Aggregate

func (as *AttachmentSelect) Aggregate(fns ...AggregateFunc) *AttachmentSelect

Aggregate adds the given aggregation functions to the selector query.

func (*AttachmentSelect) Bool

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

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

func (*AttachmentSelect) BoolX

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

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

func (*AttachmentSelect) Bools

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

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

func (*AttachmentSelect) BoolsX

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

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

func (*AttachmentSelect) Float64

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

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

func (*AttachmentSelect) Float64X

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

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

func (*AttachmentSelect) Float64s

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

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

func (*AttachmentSelect) Float64sX

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

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

func (*AttachmentSelect) Int

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

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

func (*AttachmentSelect) IntX

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

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

func (*AttachmentSelect) Ints

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

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

func (*AttachmentSelect) IntsX

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

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

func (*AttachmentSelect) Scan

func (as *AttachmentSelect) Scan(ctx context.Context, v any) error

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

func (*AttachmentSelect) ScanX

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

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

func (*AttachmentSelect) String

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

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

func (*AttachmentSelect) StringX

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

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

func (*AttachmentSelect) Strings

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

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

func (*AttachmentSelect) StringsX

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

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

type AttachmentUpdate

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

AttachmentUpdate is the builder for updating Attachment entities.

func (*AttachmentUpdate) ClearDeletedAt

func (au *AttachmentUpdate) ClearDeletedAt() *AttachmentUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*AttachmentUpdate) ClearFilePath

func (au *AttachmentUpdate) ClearFilePath() *AttachmentUpdate

ClearFilePath clears the value of the "file_path" field.

func (*AttachmentUpdate) ClearFileType

func (au *AttachmentUpdate) ClearFileType() *AttachmentUpdate

ClearFileType clears the value of the "file_type" field.

func (*AttachmentUpdate) ClearPatient

func (au *AttachmentUpdate) ClearPatient() *AttachmentUpdate

ClearPatient clears the "patient" edge to the Patient entity.

func (*AttachmentUpdate) ClearUpdatedAt

func (au *AttachmentUpdate) ClearUpdatedAt() *AttachmentUpdate

ClearUpdatedAt clears the value of the "updated_at" field.

func (*AttachmentUpdate) ClearVisit

func (au *AttachmentUpdate) ClearVisit() *AttachmentUpdate

ClearVisit clears the "visit" edge to the Visit entity.

func (*AttachmentUpdate) Exec

func (au *AttachmentUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*AttachmentUpdate) ExecX

func (au *AttachmentUpdate) ExecX(ctx context.Context)

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

func (*AttachmentUpdate) Mutation

func (au *AttachmentUpdate) Mutation() *AttachmentMutation

Mutation returns the AttachmentMutation object of the builder.

func (*AttachmentUpdate) Save

func (au *AttachmentUpdate) Save(ctx context.Context) (int, error)

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

func (*AttachmentUpdate) SaveX

func (au *AttachmentUpdate) SaveX(ctx context.Context) int

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

func (*AttachmentUpdate) SetCreatedAt

func (au *AttachmentUpdate) SetCreatedAt(t time.Time) *AttachmentUpdate

SetCreatedAt sets the "created_at" field.

func (*AttachmentUpdate) SetDeletedAt

func (au *AttachmentUpdate) SetDeletedAt(t time.Time) *AttachmentUpdate

SetDeletedAt sets the "deleted_at" field.

func (*AttachmentUpdate) SetFilePath

func (au *AttachmentUpdate) SetFilePath(s string) *AttachmentUpdate

SetFilePath sets the "file_path" field.

func (*AttachmentUpdate) SetFileType

func (au *AttachmentUpdate) SetFileType(s string) *AttachmentUpdate

SetFileType sets the "file_type" field.

func (*AttachmentUpdate) SetNillableCreatedAt

func (au *AttachmentUpdate) SetNillableCreatedAt(t *time.Time) *AttachmentUpdate

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

func (*AttachmentUpdate) SetNillableDeletedAt

func (au *AttachmentUpdate) SetNillableDeletedAt(t *time.Time) *AttachmentUpdate

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

func (*AttachmentUpdate) SetNillableFilePath

func (au *AttachmentUpdate) SetNillableFilePath(s *string) *AttachmentUpdate

SetNillableFilePath sets the "file_path" field if the given value is not nil.

func (*AttachmentUpdate) SetNillableFileType

func (au *AttachmentUpdate) SetNillableFileType(s *string) *AttachmentUpdate

SetNillableFileType sets the "file_type" field if the given value is not nil.

func (*AttachmentUpdate) SetNillablePatientID

func (au *AttachmentUpdate) SetNillablePatientID(id *int) *AttachmentUpdate

SetNillablePatientID sets the "patient" edge to the Patient entity by ID if the given value is not nil.

func (*AttachmentUpdate) SetNillableUpdatedAt

func (au *AttachmentUpdate) SetNillableUpdatedAt(t *time.Time) *AttachmentUpdate

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

func (*AttachmentUpdate) SetNillableVisitID

func (au *AttachmentUpdate) SetNillableVisitID(id *int) *AttachmentUpdate

SetNillableVisitID sets the "visit" edge to the Visit entity by ID if the given value is not nil.

func (*AttachmentUpdate) SetPatient

func (au *AttachmentUpdate) SetPatient(p *Patient) *AttachmentUpdate

SetPatient sets the "patient" edge to the Patient entity.

func (*AttachmentUpdate) SetPatientID

func (au *AttachmentUpdate) SetPatientID(id int) *AttachmentUpdate

SetPatientID sets the "patient" edge to the Patient entity by ID.

func (*AttachmentUpdate) SetUpdatedAt

func (au *AttachmentUpdate) SetUpdatedAt(t time.Time) *AttachmentUpdate

SetUpdatedAt sets the "updated_at" field.

func (*AttachmentUpdate) SetVisit

func (au *AttachmentUpdate) SetVisit(v *Visit) *AttachmentUpdate

SetVisit sets the "visit" edge to the Visit entity.

func (*AttachmentUpdate) SetVisitID

func (au *AttachmentUpdate) SetVisitID(id int) *AttachmentUpdate

SetVisitID sets the "visit" edge to the Visit entity by ID.

func (*AttachmentUpdate) Where

Where appends a list predicates to the AttachmentUpdate builder.

type AttachmentUpdateOne

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

AttachmentUpdateOne is the builder for updating a single Attachment entity.

func (*AttachmentUpdateOne) ClearDeletedAt

func (auo *AttachmentUpdateOne) ClearDeletedAt() *AttachmentUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*AttachmentUpdateOne) ClearFilePath

func (auo *AttachmentUpdateOne) ClearFilePath() *AttachmentUpdateOne

ClearFilePath clears the value of the "file_path" field.

func (*AttachmentUpdateOne) ClearFileType

func (auo *AttachmentUpdateOne) ClearFileType() *AttachmentUpdateOne

ClearFileType clears the value of the "file_type" field.

func (*AttachmentUpdateOne) ClearPatient

func (auo *AttachmentUpdateOne) ClearPatient() *AttachmentUpdateOne

ClearPatient clears the "patient" edge to the Patient entity.

func (*AttachmentUpdateOne) ClearUpdatedAt

func (auo *AttachmentUpdateOne) ClearUpdatedAt() *AttachmentUpdateOne

ClearUpdatedAt clears the value of the "updated_at" field.

func (*AttachmentUpdateOne) ClearVisit

func (auo *AttachmentUpdateOne) ClearVisit() *AttachmentUpdateOne

ClearVisit clears the "visit" edge to the Visit entity.

func (*AttachmentUpdateOne) Exec

func (auo *AttachmentUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*AttachmentUpdateOne) ExecX

func (auo *AttachmentUpdateOne) ExecX(ctx context.Context)

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

func (*AttachmentUpdateOne) Mutation

func (auo *AttachmentUpdateOne) Mutation() *AttachmentMutation

Mutation returns the AttachmentMutation object of the builder.

func (*AttachmentUpdateOne) Save

func (auo *AttachmentUpdateOne) Save(ctx context.Context) (*Attachment, error)

Save executes the query and returns the updated Attachment entity.

func (*AttachmentUpdateOne) SaveX

func (auo *AttachmentUpdateOne) SaveX(ctx context.Context) *Attachment

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

func (*AttachmentUpdateOne) Select

func (auo *AttachmentUpdateOne) Select(field string, fields ...string) *AttachmentUpdateOne

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

func (*AttachmentUpdateOne) SetCreatedAt

func (auo *AttachmentUpdateOne) SetCreatedAt(t time.Time) *AttachmentUpdateOne

SetCreatedAt sets the "created_at" field.

func (*AttachmentUpdateOne) SetDeletedAt

func (auo *AttachmentUpdateOne) SetDeletedAt(t time.Time) *AttachmentUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*AttachmentUpdateOne) SetFilePath

func (auo *AttachmentUpdateOne) SetFilePath(s string) *AttachmentUpdateOne

SetFilePath sets the "file_path" field.

func (*AttachmentUpdateOne) SetFileType

func (auo *AttachmentUpdateOne) SetFileType(s string) *AttachmentUpdateOne

SetFileType sets the "file_type" field.

func (*AttachmentUpdateOne) SetNillableCreatedAt

func (auo *AttachmentUpdateOne) SetNillableCreatedAt(t *time.Time) *AttachmentUpdateOne

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

func (*AttachmentUpdateOne) SetNillableDeletedAt

func (auo *AttachmentUpdateOne) SetNillableDeletedAt(t *time.Time) *AttachmentUpdateOne

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

func (*AttachmentUpdateOne) SetNillableFilePath

func (auo *AttachmentUpdateOne) SetNillableFilePath(s *string) *AttachmentUpdateOne

SetNillableFilePath sets the "file_path" field if the given value is not nil.

func (*AttachmentUpdateOne) SetNillableFileType

func (auo *AttachmentUpdateOne) SetNillableFileType(s *string) *AttachmentUpdateOne

SetNillableFileType sets the "file_type" field if the given value is not nil.

func (*AttachmentUpdateOne) SetNillablePatientID

func (auo *AttachmentUpdateOne) SetNillablePatientID(id *int) *AttachmentUpdateOne

SetNillablePatientID sets the "patient" edge to the Patient entity by ID if the given value is not nil.

func (*AttachmentUpdateOne) SetNillableUpdatedAt

func (auo *AttachmentUpdateOne) SetNillableUpdatedAt(t *time.Time) *AttachmentUpdateOne

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

func (*AttachmentUpdateOne) SetNillableVisitID

func (auo *AttachmentUpdateOne) SetNillableVisitID(id *int) *AttachmentUpdateOne

SetNillableVisitID sets the "visit" edge to the Visit entity by ID if the given value is not nil.

func (*AttachmentUpdateOne) SetPatient

func (auo *AttachmentUpdateOne) SetPatient(p *Patient) *AttachmentUpdateOne

SetPatient sets the "patient" edge to the Patient entity.

func (*AttachmentUpdateOne) SetPatientID

func (auo *AttachmentUpdateOne) SetPatientID(id int) *AttachmentUpdateOne

SetPatientID sets the "patient" edge to the Patient entity by ID.

func (*AttachmentUpdateOne) SetUpdatedAt

func (auo *AttachmentUpdateOne) SetUpdatedAt(t time.Time) *AttachmentUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*AttachmentUpdateOne) SetVisit

func (auo *AttachmentUpdateOne) SetVisit(v *Visit) *AttachmentUpdateOne

SetVisit sets the "visit" edge to the Visit entity.

func (*AttachmentUpdateOne) SetVisitID

func (auo *AttachmentUpdateOne) SetVisitID(id int) *AttachmentUpdateOne

SetVisitID sets the "visit" edge to the Visit entity by ID.

func (*AttachmentUpdateOne) Where

Where appends a list predicates to the AttachmentUpdate builder.

type Attachments

type Attachments []*Attachment

Attachments is a parsable slice of Attachment.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Attachment is the client for interacting with the Attachment builders.
	Attachment *AttachmentClient
	// Patient is the client for interacting with the Patient builders.
	Patient *PatientClient
	// Reception is the client for interacting with the Reception builders.
	Reception *ReceptionClient
	// Visit is the client for interacting with the Visit builders.
	Visit *VisitClient
	// 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().
	Attachment.
	Query().
	Count(ctx)

func (*Client) Intercept

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

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

func (*Client) Mutate

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

Mutate implements the ent.Mutator interface.

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

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

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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

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

type Committer

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

Committer is the interface that wraps the Commit method.

type ConstraintError

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

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

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Hook

type Hook = ent.Hook

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

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

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

type Interceptor

type Interceptor = ent.Interceptor

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

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NotFoundError

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

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

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

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

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

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

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

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

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

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

type Patient

type Patient struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// FirstName holds the value of the "first_name" field.
	FirstName string `json:"first_name,omitempty"`
	// LastName holds the value of the "last_name" field.
	LastName string `json:"last_name,omitempty"`
	// FatherName holds the value of the "father_name" field.
	FatherName string `json:"father_name,omitempty"`
	// Phone holds the value of the "phone" field.
	Phone string `json:"phone,omitempty"`
	// NationalCode holds the value of the "national_code" field.
	NationalCode string `json:"national_code,omitempty"`
	// IdentityCode holds the value of the "identity_code" field.
	IdentityCode string `json:"identity_code,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt time.Time `json:"deleted_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the PatientQuery when eager-loading is set.
	Edges PatientEdges `json:"edges"`
	// contains filtered or unexported fields
}

Patient is the model entity for the Patient schema.

func (*Patient) QueryAttachment

func (pa *Patient) QueryAttachment() *AttachmentQuery

QueryAttachment queries the "attachment" edge of the Patient entity.

func (*Patient) QueryReception

func (pa *Patient) QueryReception() *ReceptionQuery

QueryReception queries the "reception" edge of the Patient entity.

func (*Patient) String

func (pa *Patient) String() string

String implements the fmt.Stringer.

func (*Patient) Unwrap

func (pa *Patient) Unwrap() *Patient

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

func (pa *Patient) Update() *PatientUpdateOne

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

func (*Patient) Value

func (pa *Patient) Value(name string) (ent.Value, error)

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

type PatientClient

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

PatientClient is a client for the Patient schema.

func NewPatientClient

func NewPatientClient(c config) *PatientClient

NewPatientClient returns a client for the Patient from the given config.

func (*PatientClient) Create

func (c *PatientClient) Create() *PatientCreate

Create returns a builder for creating a Patient entity.

func (*PatientClient) CreateBulk

func (c *PatientClient) CreateBulk(builders ...*PatientCreate) *PatientCreateBulk

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

func (*PatientClient) Delete

func (c *PatientClient) Delete() *PatientDelete

Delete returns a delete builder for Patient.

func (*PatientClient) DeleteOne

func (c *PatientClient) DeleteOne(pa *Patient) *PatientDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*PatientClient) DeleteOneID

func (c *PatientClient) DeleteOneID(id int) *PatientDeleteOne

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

func (*PatientClient) Get

func (c *PatientClient) Get(ctx context.Context, id int) (*Patient, error)

Get returns a Patient entity by its id.

func (*PatientClient) GetX

func (c *PatientClient) GetX(ctx context.Context, id int) *Patient

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

func (*PatientClient) Hooks

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

Hooks returns the client hooks.

func (*PatientClient) Intercept

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

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

func (*PatientClient) Interceptors

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

Interceptors returns the client interceptors.

func (*PatientClient) Query

func (c *PatientClient) Query() *PatientQuery

Query returns a query builder for Patient.

func (*PatientClient) QueryAttachment

func (c *PatientClient) QueryAttachment(pa *Patient) *AttachmentQuery

QueryAttachment queries the attachment edge of a Patient.

func (*PatientClient) QueryReception

func (c *PatientClient) QueryReception(pa *Patient) *ReceptionQuery

QueryReception queries the reception edge of a Patient.

func (*PatientClient) Update

func (c *PatientClient) Update() *PatientUpdate

Update returns an update builder for Patient.

func (*PatientClient) UpdateOne

func (c *PatientClient) UpdateOne(pa *Patient) *PatientUpdateOne

UpdateOne returns an update builder for the given entity.

func (*PatientClient) UpdateOneID

func (c *PatientClient) UpdateOneID(id int) *PatientUpdateOne

UpdateOneID returns an update builder for the given id.

func (*PatientClient) Use

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

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

type PatientCreate

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

PatientCreate is the builder for creating a Patient entity.

func (*PatientCreate) AddAttachment

func (pc *PatientCreate) AddAttachment(a ...*Attachment) *PatientCreate

AddAttachment adds the "attachment" edges to the Attachment entity.

func (*PatientCreate) AddAttachmentIDs

func (pc *PatientCreate) AddAttachmentIDs(ids ...int) *PatientCreate

AddAttachmentIDs adds the "attachment" edge to the Attachment entity by IDs.

func (*PatientCreate) AddReception

func (pc *PatientCreate) AddReception(r ...*Reception) *PatientCreate

AddReception adds the "reception" edges to the Reception entity.

func (*PatientCreate) AddReceptionIDs

func (pc *PatientCreate) AddReceptionIDs(ids ...int) *PatientCreate

AddReceptionIDs adds the "reception" edge to the Reception entity by IDs.

func (*PatientCreate) Exec

func (pc *PatientCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*PatientCreate) ExecX

func (pc *PatientCreate) ExecX(ctx context.Context)

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

func (*PatientCreate) Mutation

func (pc *PatientCreate) Mutation() *PatientMutation

Mutation returns the PatientMutation object of the builder.

func (*PatientCreate) Save

func (pc *PatientCreate) Save(ctx context.Context) (*Patient, error)

Save creates the Patient in the database.

func (*PatientCreate) SaveX

func (pc *PatientCreate) SaveX(ctx context.Context) *Patient

SaveX calls Save and panics if Save returns an error.

func (*PatientCreate) SetCreatedAt

func (pc *PatientCreate) SetCreatedAt(t time.Time) *PatientCreate

SetCreatedAt sets the "created_at" field.

func (*PatientCreate) SetDeletedAt

func (pc *PatientCreate) SetDeletedAt(t time.Time) *PatientCreate

SetDeletedAt sets the "deleted_at" field.

func (*PatientCreate) SetFatherName

func (pc *PatientCreate) SetFatherName(s string) *PatientCreate

SetFatherName sets the "father_name" field.

func (*PatientCreate) SetFirstName

func (pc *PatientCreate) SetFirstName(s string) *PatientCreate

SetFirstName sets the "first_name" field.

func (*PatientCreate) SetIdentityCode

func (pc *PatientCreate) SetIdentityCode(s string) *PatientCreate

SetIdentityCode sets the "identity_code" field.

func (*PatientCreate) SetLastName

func (pc *PatientCreate) SetLastName(s string) *PatientCreate

SetLastName sets the "last_name" field.

func (*PatientCreate) SetNationalCode

func (pc *PatientCreate) SetNationalCode(s string) *PatientCreate

SetNationalCode sets the "national_code" field.

func (*PatientCreate) SetNillableCreatedAt

func (pc *PatientCreate) SetNillableCreatedAt(t *time.Time) *PatientCreate

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

func (*PatientCreate) SetNillableDeletedAt

func (pc *PatientCreate) SetNillableDeletedAt(t *time.Time) *PatientCreate

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

func (*PatientCreate) SetNillableFatherName

func (pc *PatientCreate) SetNillableFatherName(s *string) *PatientCreate

SetNillableFatherName sets the "father_name" field if the given value is not nil.

func (*PatientCreate) SetNillableFirstName

func (pc *PatientCreate) SetNillableFirstName(s *string) *PatientCreate

SetNillableFirstName sets the "first_name" field if the given value is not nil.

func (*PatientCreate) SetNillableIdentityCode

func (pc *PatientCreate) SetNillableIdentityCode(s *string) *PatientCreate

SetNillableIdentityCode sets the "identity_code" field if the given value is not nil.

func (*PatientCreate) SetNillableLastName

func (pc *PatientCreate) SetNillableLastName(s *string) *PatientCreate

SetNillableLastName sets the "last_name" field if the given value is not nil.

func (*PatientCreate) SetNillableNationalCode

func (pc *PatientCreate) SetNillableNationalCode(s *string) *PatientCreate

SetNillableNationalCode sets the "national_code" field if the given value is not nil.

func (*PatientCreate) SetNillablePhone

func (pc *PatientCreate) SetNillablePhone(s *string) *PatientCreate

SetNillablePhone sets the "phone" field if the given value is not nil.

func (*PatientCreate) SetNillableUpdatedAt

func (pc *PatientCreate) SetNillableUpdatedAt(t *time.Time) *PatientCreate

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

func (*PatientCreate) SetPhone

func (pc *PatientCreate) SetPhone(s string) *PatientCreate

SetPhone sets the "phone" field.

func (*PatientCreate) SetUpdatedAt

func (pc *PatientCreate) SetUpdatedAt(t time.Time) *PatientCreate

SetUpdatedAt sets the "updated_at" field.

type PatientCreateBulk

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

PatientCreateBulk is the builder for creating many Patient entities in bulk.

func (*PatientCreateBulk) Exec

func (pcb *PatientCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*PatientCreateBulk) ExecX

func (pcb *PatientCreateBulk) ExecX(ctx context.Context)

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

func (*PatientCreateBulk) Save

func (pcb *PatientCreateBulk) Save(ctx context.Context) ([]*Patient, error)

Save creates the Patient entities in the database.

func (*PatientCreateBulk) SaveX

func (pcb *PatientCreateBulk) SaveX(ctx context.Context) []*Patient

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

type PatientDelete

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

PatientDelete is the builder for deleting a Patient entity.

func (*PatientDelete) Exec

func (pd *PatientDelete) Exec(ctx context.Context) (int, error)

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

func (*PatientDelete) ExecX

func (pd *PatientDelete) ExecX(ctx context.Context) int

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

func (*PatientDelete) Where

func (pd *PatientDelete) Where(ps ...predicate.Patient) *PatientDelete

Where appends a list predicates to the PatientDelete builder.

type PatientDeleteOne

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

PatientDeleteOne is the builder for deleting a single Patient entity.

func (*PatientDeleteOne) Exec

func (pdo *PatientDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*PatientDeleteOne) ExecX

func (pdo *PatientDeleteOne) ExecX(ctx context.Context)

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

func (*PatientDeleteOne) Where

Where appends a list predicates to the PatientDelete builder.

type PatientEdges

type PatientEdges struct {
	// Attachment holds the value of the attachment edge.
	Attachment []*Attachment `json:"attachment,omitempty"`
	// Reception holds the value of the reception edge.
	Reception []*Reception `json:"reception,omitempty"`
	// contains filtered or unexported fields
}

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

func (PatientEdges) AttachmentOrErr

func (e PatientEdges) AttachmentOrErr() ([]*Attachment, error)

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

func (PatientEdges) ReceptionOrErr

func (e PatientEdges) ReceptionOrErr() ([]*Reception, error)

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

type PatientGroupBy

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

PatientGroupBy is the group-by builder for Patient entities.

func (*PatientGroupBy) Aggregate

func (pgb *PatientGroupBy) Aggregate(fns ...AggregateFunc) *PatientGroupBy

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

func (*PatientGroupBy) Bool

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

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

func (*PatientGroupBy) BoolX

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

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

func (*PatientGroupBy) Bools

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

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

func (*PatientGroupBy) BoolsX

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

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

func (*PatientGroupBy) Float64

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

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

func (*PatientGroupBy) Float64X

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

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

func (*PatientGroupBy) Float64s

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

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

func (*PatientGroupBy) Float64sX

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

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

func (*PatientGroupBy) Int

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

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

func (*PatientGroupBy) IntX

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

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

func (*PatientGroupBy) Ints

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

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

func (*PatientGroupBy) IntsX

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

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

func (*PatientGroupBy) Scan

func (pgb *PatientGroupBy) Scan(ctx context.Context, v any) error

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

func (*PatientGroupBy) ScanX

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

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

func (*PatientGroupBy) String

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

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

func (*PatientGroupBy) StringX

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

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

func (*PatientGroupBy) Strings

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

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

func (*PatientGroupBy) StringsX

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

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

type PatientMutation

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

PatientMutation represents an operation that mutates the Patient nodes in the graph.

func (*PatientMutation) AddAttachmentIDs

func (m *PatientMutation) AddAttachmentIDs(ids ...int)

AddAttachmentIDs adds the "attachment" edge to the Attachment entity by ids.

func (*PatientMutation) AddField

func (m *PatientMutation) 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 (*PatientMutation) AddReceptionIDs

func (m *PatientMutation) AddReceptionIDs(ids ...int)

AddReceptionIDs adds the "reception" edge to the Reception entity by ids.

func (*PatientMutation) AddedEdges

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

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

func (*PatientMutation) AddedField

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

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

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

func (*PatientMutation) AddedIDs

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

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

func (*PatientMutation) AttachmentCleared

func (m *PatientMutation) AttachmentCleared() bool

AttachmentCleared reports if the "attachment" edge to the Attachment entity was cleared.

func (*PatientMutation) AttachmentIDs

func (m *PatientMutation) AttachmentIDs() (ids []int)

AttachmentIDs returns the "attachment" edge IDs in the mutation.

func (*PatientMutation) ClearAttachment

func (m *PatientMutation) ClearAttachment()

ClearAttachment clears the "attachment" edge to the Attachment entity.

func (*PatientMutation) ClearDeletedAt

func (m *PatientMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*PatientMutation) ClearEdge

func (m *PatientMutation) 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 (*PatientMutation) ClearFatherName

func (m *PatientMutation) ClearFatherName()

ClearFatherName clears the value of the "father_name" field.

func (*PatientMutation) ClearField

func (m *PatientMutation) 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 (*PatientMutation) ClearFirstName

func (m *PatientMutation) ClearFirstName()

ClearFirstName clears the value of the "first_name" field.

func (*PatientMutation) ClearIdentityCode

func (m *PatientMutation) ClearIdentityCode()

ClearIdentityCode clears the value of the "identity_code" field.

func (*PatientMutation) ClearLastName

func (m *PatientMutation) ClearLastName()

ClearLastName clears the value of the "last_name" field.

func (*PatientMutation) ClearNationalCode

func (m *PatientMutation) ClearNationalCode()

ClearNationalCode clears the value of the "national_code" field.

func (*PatientMutation) ClearPhone

func (m *PatientMutation) ClearPhone()

ClearPhone clears the value of the "phone" field.

func (*PatientMutation) ClearReception

func (m *PatientMutation) ClearReception()

ClearReception clears the "reception" edge to the Reception entity.

func (*PatientMutation) ClearUpdatedAt

func (m *PatientMutation) ClearUpdatedAt()

ClearUpdatedAt clears the value of the "updated_at" field.

func (*PatientMutation) ClearedEdges

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

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

func (*PatientMutation) ClearedFields

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

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

func (PatientMutation) Client

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

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

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

func (*PatientMutation) DeletedAt

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

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

func (*PatientMutation) DeletedAtCleared

func (m *PatientMutation) DeletedAtCleared() bool

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

func (*PatientMutation) EdgeCleared

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

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

func (*PatientMutation) FatherName

func (m *PatientMutation) FatherName() (r string, exists bool)

FatherName returns the value of the "father_name" field in the mutation.

func (*PatientMutation) FatherNameCleared

func (m *PatientMutation) FatherNameCleared() bool

FatherNameCleared returns if the "father_name" field was cleared in this mutation.

func (*PatientMutation) Field

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

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

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

func (*PatientMutation) Fields

func (m *PatientMutation) 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 (*PatientMutation) FirstName

func (m *PatientMutation) FirstName() (r string, exists bool)

FirstName returns the value of the "first_name" field in the mutation.

func (*PatientMutation) FirstNameCleared

func (m *PatientMutation) FirstNameCleared() bool

FirstNameCleared returns if the "first_name" field was cleared in this mutation.

func (*PatientMutation) ID

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

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

func (*PatientMutation) IDs

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

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

func (*PatientMutation) IdentityCode

func (m *PatientMutation) IdentityCode() (r string, exists bool)

IdentityCode returns the value of the "identity_code" field in the mutation.

func (*PatientMutation) IdentityCodeCleared

func (m *PatientMutation) IdentityCodeCleared() bool

IdentityCodeCleared returns if the "identity_code" field was cleared in this mutation.

func (*PatientMutation) LastName

func (m *PatientMutation) LastName() (r string, exists bool)

LastName returns the value of the "last_name" field in the mutation.

func (*PatientMutation) LastNameCleared

func (m *PatientMutation) LastNameCleared() bool

LastNameCleared returns if the "last_name" field was cleared in this mutation.

func (*PatientMutation) NationalCode

func (m *PatientMutation) NationalCode() (r string, exists bool)

NationalCode returns the value of the "national_code" field in the mutation.

func (*PatientMutation) NationalCodeCleared

func (m *PatientMutation) NationalCodeCleared() bool

NationalCodeCleared returns if the "national_code" field was cleared in this mutation.

func (*PatientMutation) OldCreatedAt

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

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

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

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

func (m *PatientMutation) OldFatherName(ctx context.Context) (v string, err error)

OldFatherName returns the old "father_name" field's value of the Patient entity. If the Patient 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 (*PatientMutation) OldField

func (m *PatientMutation) 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 (*PatientMutation) OldFirstName

func (m *PatientMutation) OldFirstName(ctx context.Context) (v string, err error)

OldFirstName returns the old "first_name" field's value of the Patient entity. If the Patient 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 (*PatientMutation) OldIdentityCode

func (m *PatientMutation) OldIdentityCode(ctx context.Context) (v string, err error)

OldIdentityCode returns the old "identity_code" field's value of the Patient entity. If the Patient 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 (*PatientMutation) OldLastName

func (m *PatientMutation) OldLastName(ctx context.Context) (v string, err error)

OldLastName returns the old "last_name" field's value of the Patient entity. If the Patient 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 (*PatientMutation) OldNationalCode

func (m *PatientMutation) OldNationalCode(ctx context.Context) (v string, err error)

OldNationalCode returns the old "national_code" field's value of the Patient entity. If the Patient 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 (*PatientMutation) OldPhone

func (m *PatientMutation) OldPhone(ctx context.Context) (v string, err error)

OldPhone returns the old "phone" field's value of the Patient entity. If the Patient 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 (*PatientMutation) OldUpdatedAt

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

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

func (m *PatientMutation) Op() Op

Op returns the operation name.

func (*PatientMutation) Phone

func (m *PatientMutation) Phone() (r string, exists bool)

Phone returns the value of the "phone" field in the mutation.

func (*PatientMutation) PhoneCleared

func (m *PatientMutation) PhoneCleared() bool

PhoneCleared returns if the "phone" field was cleared in this mutation.

func (*PatientMutation) ReceptionCleared

func (m *PatientMutation) ReceptionCleared() bool

ReceptionCleared reports if the "reception" edge to the Reception entity was cleared.

func (*PatientMutation) ReceptionIDs

func (m *PatientMutation) ReceptionIDs() (ids []int)

ReceptionIDs returns the "reception" edge IDs in the mutation.

func (*PatientMutation) RemoveAttachmentIDs

func (m *PatientMutation) RemoveAttachmentIDs(ids ...int)

RemoveAttachmentIDs removes the "attachment" edge to the Attachment entity by IDs.

func (*PatientMutation) RemoveReceptionIDs

func (m *PatientMutation) RemoveReceptionIDs(ids ...int)

RemoveReceptionIDs removes the "reception" edge to the Reception entity by IDs.

func (*PatientMutation) RemovedAttachmentIDs

func (m *PatientMutation) RemovedAttachmentIDs() (ids []int)

RemovedAttachment returns the removed IDs of the "attachment" edge to the Attachment entity.

func (*PatientMutation) RemovedEdges

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

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

func (*PatientMutation) RemovedIDs

func (m *PatientMutation) 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 (*PatientMutation) RemovedReceptionIDs

func (m *PatientMutation) RemovedReceptionIDs() (ids []int)

RemovedReception returns the removed IDs of the "reception" edge to the Reception entity.

func (*PatientMutation) ResetAttachment

func (m *PatientMutation) ResetAttachment()

ResetAttachment resets all changes to the "attachment" edge.

func (*PatientMutation) ResetCreatedAt

func (m *PatientMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*PatientMutation) ResetDeletedAt

func (m *PatientMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*PatientMutation) ResetEdge

func (m *PatientMutation) 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 (*PatientMutation) ResetFatherName

func (m *PatientMutation) ResetFatherName()

ResetFatherName resets all changes to the "father_name" field.

func (*PatientMutation) ResetField

func (m *PatientMutation) 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 (*PatientMutation) ResetFirstName

func (m *PatientMutation) ResetFirstName()

ResetFirstName resets all changes to the "first_name" field.

func (*PatientMutation) ResetIdentityCode

func (m *PatientMutation) ResetIdentityCode()

ResetIdentityCode resets all changes to the "identity_code" field.

func (*PatientMutation) ResetLastName

func (m *PatientMutation) ResetLastName()

ResetLastName resets all changes to the "last_name" field.

func (*PatientMutation) ResetNationalCode

func (m *PatientMutation) ResetNationalCode()

ResetNationalCode resets all changes to the "national_code" field.

func (*PatientMutation) ResetPhone

func (m *PatientMutation) ResetPhone()

ResetPhone resets all changes to the "phone" field.

func (*PatientMutation) ResetReception

func (m *PatientMutation) ResetReception()

ResetReception resets all changes to the "reception" edge.

func (*PatientMutation) ResetUpdatedAt

func (m *PatientMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*PatientMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*PatientMutation) SetDeletedAt

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

SetDeletedAt sets the "deleted_at" field.

func (*PatientMutation) SetFatherName

func (m *PatientMutation) SetFatherName(s string)

SetFatherName sets the "father_name" field.

func (*PatientMutation) SetField

func (m *PatientMutation) 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 (*PatientMutation) SetFirstName

func (m *PatientMutation) SetFirstName(s string)

SetFirstName sets the "first_name" field.

func (*PatientMutation) SetIdentityCode

func (m *PatientMutation) SetIdentityCode(s string)

SetIdentityCode sets the "identity_code" field.

func (*PatientMutation) SetLastName

func (m *PatientMutation) SetLastName(s string)

SetLastName sets the "last_name" field.

func (*PatientMutation) SetNationalCode

func (m *PatientMutation) SetNationalCode(s string)

SetNationalCode sets the "national_code" field.

func (*PatientMutation) SetOp

func (m *PatientMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*PatientMutation) SetPhone

func (m *PatientMutation) SetPhone(s string)

SetPhone sets the "phone" field.

func (*PatientMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (PatientMutation) Tx

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

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

func (*PatientMutation) Type

func (m *PatientMutation) Type() string

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

func (*PatientMutation) UpdatedAt

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

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

func (*PatientMutation) UpdatedAtCleared

func (m *PatientMutation) UpdatedAtCleared() bool

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

func (*PatientMutation) Where

func (m *PatientMutation) Where(ps ...predicate.Patient)

Where appends a list predicates to the PatientMutation builder.

func (*PatientMutation) WhereP

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

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

type PatientQuery

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

PatientQuery is the builder for querying Patient entities.

func (*PatientQuery) Aggregate

func (pq *PatientQuery) Aggregate(fns ...AggregateFunc) *PatientSelect

Aggregate returns a PatientSelect configured with the given aggregations.

func (*PatientQuery) All

func (pq *PatientQuery) All(ctx context.Context) ([]*Patient, error)

All executes the query and returns a list of Patients.

func (*PatientQuery) AllX

func (pq *PatientQuery) AllX(ctx context.Context) []*Patient

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

func (*PatientQuery) Clone

func (pq *PatientQuery) Clone() *PatientQuery

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

func (*PatientQuery) Count

func (pq *PatientQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*PatientQuery) CountX

func (pq *PatientQuery) CountX(ctx context.Context) int

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

func (*PatientQuery) Exist

func (pq *PatientQuery) Exist(ctx context.Context) (bool, error)

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

func (*PatientQuery) ExistX

func (pq *PatientQuery) ExistX(ctx context.Context) bool

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

func (*PatientQuery) First

func (pq *PatientQuery) First(ctx context.Context) (*Patient, error)

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

func (*PatientQuery) FirstID

func (pq *PatientQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*PatientQuery) FirstIDX

func (pq *PatientQuery) FirstIDX(ctx context.Context) int

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

func (*PatientQuery) FirstX

func (pq *PatientQuery) FirstX(ctx context.Context) *Patient

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

func (*PatientQuery) GroupBy

func (pq *PatientQuery) GroupBy(field string, fields ...string) *PatientGroupBy

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

client.Patient.Query().
	GroupBy(patient.FieldFirstName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*PatientQuery) IDs

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

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

func (*PatientQuery) IDsX

func (pq *PatientQuery) IDsX(ctx context.Context) []int

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

func (*PatientQuery) Limit

func (pq *PatientQuery) Limit(limit int) *PatientQuery

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

func (*PatientQuery) Offset

func (pq *PatientQuery) Offset(offset int) *PatientQuery

Offset to start from.

func (*PatientQuery) Only

func (pq *PatientQuery) Only(ctx context.Context) (*Patient, error)

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

func (*PatientQuery) OnlyID

func (pq *PatientQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*PatientQuery) OnlyIDX

func (pq *PatientQuery) OnlyIDX(ctx context.Context) int

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

func (*PatientQuery) OnlyX

func (pq *PatientQuery) OnlyX(ctx context.Context) *Patient

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

func (*PatientQuery) Order

func (pq *PatientQuery) Order(o ...patient.OrderOption) *PatientQuery

Order specifies how the records should be ordered.

func (*PatientQuery) QueryAttachment

func (pq *PatientQuery) QueryAttachment() *AttachmentQuery

QueryAttachment chains the current query on the "attachment" edge.

func (*PatientQuery) QueryReception

func (pq *PatientQuery) QueryReception() *ReceptionQuery

QueryReception chains the current query on the "reception" edge.

func (*PatientQuery) Select

func (pq *PatientQuery) Select(fields ...string) *PatientSelect

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

client.Patient.Query().
	Select(patient.FieldFirstName).
	Scan(ctx, &v)

func (*PatientQuery) Unique

func (pq *PatientQuery) Unique(unique bool) *PatientQuery

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

func (pq *PatientQuery) Where(ps ...predicate.Patient) *PatientQuery

Where adds a new predicate for the PatientQuery builder.

func (*PatientQuery) WithAttachment

func (pq *PatientQuery) WithAttachment(opts ...func(*AttachmentQuery)) *PatientQuery

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

func (*PatientQuery) WithReception

func (pq *PatientQuery) WithReception(opts ...func(*ReceptionQuery)) *PatientQuery

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

type PatientSelect

type PatientSelect struct {
	*PatientQuery
	// contains filtered or unexported fields
}

PatientSelect is the builder for selecting fields of Patient entities.

func (*PatientSelect) Aggregate

func (ps *PatientSelect) Aggregate(fns ...AggregateFunc) *PatientSelect

Aggregate adds the given aggregation functions to the selector query.

func (*PatientSelect) Bool

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

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

func (*PatientSelect) BoolX

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

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

func (*PatientSelect) Bools

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

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

func (*PatientSelect) BoolsX

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

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

func (*PatientSelect) Float64

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

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

func (*PatientSelect) Float64X

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

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

func (*PatientSelect) Float64s

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

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

func (*PatientSelect) Float64sX

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

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

func (*PatientSelect) Int

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

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

func (*PatientSelect) IntX

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

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

func (*PatientSelect) Ints

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

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

func (*PatientSelect) IntsX

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

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

func (*PatientSelect) Scan

func (ps *PatientSelect) Scan(ctx context.Context, v any) error

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

func (*PatientSelect) ScanX

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

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

func (*PatientSelect) String

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

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

func (*PatientSelect) StringX

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

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

func (*PatientSelect) Strings

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

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

func (*PatientSelect) StringsX

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

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

type PatientUpdate

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

PatientUpdate is the builder for updating Patient entities.

func (*PatientUpdate) AddAttachment

func (pu *PatientUpdate) AddAttachment(a ...*Attachment) *PatientUpdate

AddAttachment adds the "attachment" edges to the Attachment entity.

func (*PatientUpdate) AddAttachmentIDs

func (pu *PatientUpdate) AddAttachmentIDs(ids ...int) *PatientUpdate

AddAttachmentIDs adds the "attachment" edge to the Attachment entity by IDs.

func (*PatientUpdate) AddReception

func (pu *PatientUpdate) AddReception(r ...*Reception) *PatientUpdate

AddReception adds the "reception" edges to the Reception entity.

func (*PatientUpdate) AddReceptionIDs

func (pu *PatientUpdate) AddReceptionIDs(ids ...int) *PatientUpdate

AddReceptionIDs adds the "reception" edge to the Reception entity by IDs.

func (*PatientUpdate) ClearAttachment

func (pu *PatientUpdate) ClearAttachment() *PatientUpdate

ClearAttachment clears all "attachment" edges to the Attachment entity.

func (*PatientUpdate) ClearDeletedAt

func (pu *PatientUpdate) ClearDeletedAt() *PatientUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*PatientUpdate) ClearFatherName

func (pu *PatientUpdate) ClearFatherName() *PatientUpdate

ClearFatherName clears the value of the "father_name" field.

func (*PatientUpdate) ClearFirstName

func (pu *PatientUpdate) ClearFirstName() *PatientUpdate

ClearFirstName clears the value of the "first_name" field.

func (*PatientUpdate) ClearIdentityCode

func (pu *PatientUpdate) ClearIdentityCode() *PatientUpdate

ClearIdentityCode clears the value of the "identity_code" field.

func (*PatientUpdate) ClearLastName

func (pu *PatientUpdate) ClearLastName() *PatientUpdate

ClearLastName clears the value of the "last_name" field.

func (*PatientUpdate) ClearNationalCode

func (pu *PatientUpdate) ClearNationalCode() *PatientUpdate

ClearNationalCode clears the value of the "national_code" field.

func (*PatientUpdate) ClearPhone

func (pu *PatientUpdate) ClearPhone() *PatientUpdate

ClearPhone clears the value of the "phone" field.

func (*PatientUpdate) ClearReception

func (pu *PatientUpdate) ClearReception() *PatientUpdate

ClearReception clears all "reception" edges to the Reception entity.

func (*PatientUpdate) ClearUpdatedAt

func (pu *PatientUpdate) ClearUpdatedAt() *PatientUpdate

ClearUpdatedAt clears the value of the "updated_at" field.

func (*PatientUpdate) Exec

func (pu *PatientUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*PatientUpdate) ExecX

func (pu *PatientUpdate) ExecX(ctx context.Context)

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

func (*PatientUpdate) Mutation

func (pu *PatientUpdate) Mutation() *PatientMutation

Mutation returns the PatientMutation object of the builder.

func (*PatientUpdate) RemoveAttachment

func (pu *PatientUpdate) RemoveAttachment(a ...*Attachment) *PatientUpdate

RemoveAttachment removes "attachment" edges to Attachment entities.

func (*PatientUpdate) RemoveAttachmentIDs

func (pu *PatientUpdate) RemoveAttachmentIDs(ids ...int) *PatientUpdate

RemoveAttachmentIDs removes the "attachment" edge to Attachment entities by IDs.

func (*PatientUpdate) RemoveReception

func (pu *PatientUpdate) RemoveReception(r ...*Reception) *PatientUpdate

RemoveReception removes "reception" edges to Reception entities.

func (*PatientUpdate) RemoveReceptionIDs

func (pu *PatientUpdate) RemoveReceptionIDs(ids ...int) *PatientUpdate

RemoveReceptionIDs removes the "reception" edge to Reception entities by IDs.

func (*PatientUpdate) Save

func (pu *PatientUpdate) Save(ctx context.Context) (int, error)

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

func (*PatientUpdate) SaveX

func (pu *PatientUpdate) SaveX(ctx context.Context) int

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

func (*PatientUpdate) SetDeletedAt

func (pu *PatientUpdate) SetDeletedAt(t time.Time) *PatientUpdate

SetDeletedAt sets the "deleted_at" field.

func (*PatientUpdate) SetFatherName

func (pu *PatientUpdate) SetFatherName(s string) *PatientUpdate

SetFatherName sets the "father_name" field.

func (*PatientUpdate) SetFirstName

func (pu *PatientUpdate) SetFirstName(s string) *PatientUpdate

SetFirstName sets the "first_name" field.

func (*PatientUpdate) SetIdentityCode

func (pu *PatientUpdate) SetIdentityCode(s string) *PatientUpdate

SetIdentityCode sets the "identity_code" field.

func (*PatientUpdate) SetLastName

func (pu *PatientUpdate) SetLastName(s string) *PatientUpdate

SetLastName sets the "last_name" field.

func (*PatientUpdate) SetNationalCode

func (pu *PatientUpdate) SetNationalCode(s string) *PatientUpdate

SetNationalCode sets the "national_code" field.

func (*PatientUpdate) SetNillableDeletedAt

func (pu *PatientUpdate) SetNillableDeletedAt(t *time.Time) *PatientUpdate

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

func (*PatientUpdate) SetNillableFatherName

func (pu *PatientUpdate) SetNillableFatherName(s *string) *PatientUpdate

SetNillableFatherName sets the "father_name" field if the given value is not nil.

func (*PatientUpdate) SetNillableFirstName

func (pu *PatientUpdate) SetNillableFirstName(s *string) *PatientUpdate

SetNillableFirstName sets the "first_name" field if the given value is not nil.

func (*PatientUpdate) SetNillableIdentityCode

func (pu *PatientUpdate) SetNillableIdentityCode(s *string) *PatientUpdate

SetNillableIdentityCode sets the "identity_code" field if the given value is not nil.

func (*PatientUpdate) SetNillableLastName

func (pu *PatientUpdate) SetNillableLastName(s *string) *PatientUpdate

SetNillableLastName sets the "last_name" field if the given value is not nil.

func (*PatientUpdate) SetNillableNationalCode

func (pu *PatientUpdate) SetNillableNationalCode(s *string) *PatientUpdate

SetNillableNationalCode sets the "national_code" field if the given value is not nil.

func (*PatientUpdate) SetNillablePhone

func (pu *PatientUpdate) SetNillablePhone(s *string) *PatientUpdate

SetNillablePhone sets the "phone" field if the given value is not nil.

func (*PatientUpdate) SetNillableUpdatedAt

func (pu *PatientUpdate) SetNillableUpdatedAt(t *time.Time) *PatientUpdate

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

func (*PatientUpdate) SetPhone

func (pu *PatientUpdate) SetPhone(s string) *PatientUpdate

SetPhone sets the "phone" field.

func (*PatientUpdate) SetUpdatedAt

func (pu *PatientUpdate) SetUpdatedAt(t time.Time) *PatientUpdate

SetUpdatedAt sets the "updated_at" field.

func (*PatientUpdate) Where

func (pu *PatientUpdate) Where(ps ...predicate.Patient) *PatientUpdate

Where appends a list predicates to the PatientUpdate builder.

type PatientUpdateOne

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

PatientUpdateOne is the builder for updating a single Patient entity.

func (*PatientUpdateOne) AddAttachment

func (puo *PatientUpdateOne) AddAttachment(a ...*Attachment) *PatientUpdateOne

AddAttachment adds the "attachment" edges to the Attachment entity.

func (*PatientUpdateOne) AddAttachmentIDs

func (puo *PatientUpdateOne) AddAttachmentIDs(ids ...int) *PatientUpdateOne

AddAttachmentIDs adds the "attachment" edge to the Attachment entity by IDs.

func (*PatientUpdateOne) AddReception

func (puo *PatientUpdateOne) AddReception(r ...*Reception) *PatientUpdateOne

AddReception adds the "reception" edges to the Reception entity.

func (*PatientUpdateOne) AddReceptionIDs

func (puo *PatientUpdateOne) AddReceptionIDs(ids ...int) *PatientUpdateOne

AddReceptionIDs adds the "reception" edge to the Reception entity by IDs.

func (*PatientUpdateOne) ClearAttachment

func (puo *PatientUpdateOne) ClearAttachment() *PatientUpdateOne

ClearAttachment clears all "attachment" edges to the Attachment entity.

func (*PatientUpdateOne) ClearDeletedAt

func (puo *PatientUpdateOne) ClearDeletedAt() *PatientUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*PatientUpdateOne) ClearFatherName

func (puo *PatientUpdateOne) ClearFatherName() *PatientUpdateOne

ClearFatherName clears the value of the "father_name" field.

func (*PatientUpdateOne) ClearFirstName

func (puo *PatientUpdateOne) ClearFirstName() *PatientUpdateOne

ClearFirstName clears the value of the "first_name" field.

func (*PatientUpdateOne) ClearIdentityCode

func (puo *PatientUpdateOne) ClearIdentityCode() *PatientUpdateOne

ClearIdentityCode clears the value of the "identity_code" field.

func (*PatientUpdateOne) ClearLastName

func (puo *PatientUpdateOne) ClearLastName() *PatientUpdateOne

ClearLastName clears the value of the "last_name" field.

func (*PatientUpdateOne) ClearNationalCode

func (puo *PatientUpdateOne) ClearNationalCode() *PatientUpdateOne

ClearNationalCode clears the value of the "national_code" field.

func (*PatientUpdateOne) ClearPhone

func (puo *PatientUpdateOne) ClearPhone() *PatientUpdateOne

ClearPhone clears the value of the "phone" field.

func (*PatientUpdateOne) ClearReception

func (puo *PatientUpdateOne) ClearReception() *PatientUpdateOne

ClearReception clears all "reception" edges to the Reception entity.

func (*PatientUpdateOne) ClearUpdatedAt

func (puo *PatientUpdateOne) ClearUpdatedAt() *PatientUpdateOne

ClearUpdatedAt clears the value of the "updated_at" field.

func (*PatientUpdateOne) Exec

func (puo *PatientUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*PatientUpdateOne) ExecX

func (puo *PatientUpdateOne) ExecX(ctx context.Context)

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

func (*PatientUpdateOne) Mutation

func (puo *PatientUpdateOne) Mutation() *PatientMutation

Mutation returns the PatientMutation object of the builder.

func (*PatientUpdateOne) RemoveAttachment

func (puo *PatientUpdateOne) RemoveAttachment(a ...*Attachment) *PatientUpdateOne

RemoveAttachment removes "attachment" edges to Attachment entities.

func (*PatientUpdateOne) RemoveAttachmentIDs

func (puo *PatientUpdateOne) RemoveAttachmentIDs(ids ...int) *PatientUpdateOne

RemoveAttachmentIDs removes the "attachment" edge to Attachment entities by IDs.

func (*PatientUpdateOne) RemoveReception

func (puo *PatientUpdateOne) RemoveReception(r ...*Reception) *PatientUpdateOne

RemoveReception removes "reception" edges to Reception entities.

func (*PatientUpdateOne) RemoveReceptionIDs

func (puo *PatientUpdateOne) RemoveReceptionIDs(ids ...int) *PatientUpdateOne

RemoveReceptionIDs removes the "reception" edge to Reception entities by IDs.

func (*PatientUpdateOne) Save

func (puo *PatientUpdateOne) Save(ctx context.Context) (*Patient, error)

Save executes the query and returns the updated Patient entity.

func (*PatientUpdateOne) SaveX

func (puo *PatientUpdateOne) SaveX(ctx context.Context) *Patient

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

func (*PatientUpdateOne) Select

func (puo *PatientUpdateOne) Select(field string, fields ...string) *PatientUpdateOne

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

func (*PatientUpdateOne) SetDeletedAt

func (puo *PatientUpdateOne) SetDeletedAt(t time.Time) *PatientUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*PatientUpdateOne) SetFatherName

func (puo *PatientUpdateOne) SetFatherName(s string) *PatientUpdateOne

SetFatherName sets the "father_name" field.

func (*PatientUpdateOne) SetFirstName

func (puo *PatientUpdateOne) SetFirstName(s string) *PatientUpdateOne

SetFirstName sets the "first_name" field.

func (*PatientUpdateOne) SetIdentityCode

func (puo *PatientUpdateOne) SetIdentityCode(s string) *PatientUpdateOne

SetIdentityCode sets the "identity_code" field.

func (*PatientUpdateOne) SetLastName

func (puo *PatientUpdateOne) SetLastName(s string) *PatientUpdateOne

SetLastName sets the "last_name" field.

func (*PatientUpdateOne) SetNationalCode

func (puo *PatientUpdateOne) SetNationalCode(s string) *PatientUpdateOne

SetNationalCode sets the "national_code" field.

func (*PatientUpdateOne) SetNillableDeletedAt

func (puo *PatientUpdateOne) SetNillableDeletedAt(t *time.Time) *PatientUpdateOne

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

func (*PatientUpdateOne) SetNillableFatherName

func (puo *PatientUpdateOne) SetNillableFatherName(s *string) *PatientUpdateOne

SetNillableFatherName sets the "father_name" field if the given value is not nil.

func (*PatientUpdateOne) SetNillableFirstName

func (puo *PatientUpdateOne) SetNillableFirstName(s *string) *PatientUpdateOne

SetNillableFirstName sets the "first_name" field if the given value is not nil.

func (*PatientUpdateOne) SetNillableIdentityCode

func (puo *PatientUpdateOne) SetNillableIdentityCode(s *string) *PatientUpdateOne

SetNillableIdentityCode sets the "identity_code" field if the given value is not nil.

func (*PatientUpdateOne) SetNillableLastName

func (puo *PatientUpdateOne) SetNillableLastName(s *string) *PatientUpdateOne

SetNillableLastName sets the "last_name" field if the given value is not nil.

func (*PatientUpdateOne) SetNillableNationalCode

func (puo *PatientUpdateOne) SetNillableNationalCode(s *string) *PatientUpdateOne

SetNillableNationalCode sets the "national_code" field if the given value is not nil.

func (*PatientUpdateOne) SetNillablePhone

func (puo *PatientUpdateOne) SetNillablePhone(s *string) *PatientUpdateOne

SetNillablePhone sets the "phone" field if the given value is not nil.

func (*PatientUpdateOne) SetNillableUpdatedAt

func (puo *PatientUpdateOne) SetNillableUpdatedAt(t *time.Time) *PatientUpdateOne

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

func (*PatientUpdateOne) SetPhone

func (puo *PatientUpdateOne) SetPhone(s string) *PatientUpdateOne

SetPhone sets the "phone" field.

func (*PatientUpdateOne) SetUpdatedAt

func (puo *PatientUpdateOne) SetUpdatedAt(t time.Time) *PatientUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*PatientUpdateOne) Where

Where appends a list predicates to the PatientUpdate builder.

type Patients

type Patients []*Patient

Patients is a parsable slice of Patient.

type Policy

type Policy = ent.Policy

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

type Querier

type Querier = ent.Querier

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

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

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

type Query

type Query = ent.Query

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

type QueryContext

type QueryContext = ent.QueryContext

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

type Reception

type Reception struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// ReceptionFor holds the value of the "reception_for" field.
	ReceptionFor time.Time `json:"reception_for,omitempty"`
	// VisitDuration holds the value of the "visit_duration" field.
	VisitDuration int `json:"visit_duration,omitempty"`
	// InsuranceCode holds the value of the "insurance_code" field.
	InsuranceCode string `json:"insurance_code,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt time.Time `json:"deleted_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ReceptionQuery when eager-loading is set.
	Edges ReceptionEdges `json:"edges"`
	// contains filtered or unexported fields
}

Reception is the model entity for the Reception schema.

func (*Reception) QueryPatient

func (r *Reception) QueryPatient() *PatientQuery

QueryPatient queries the "patient" edge of the Reception entity.

func (*Reception) QueryVisit

func (r *Reception) QueryVisit() *VisitQuery

QueryVisit queries the "visit" edge of the Reception entity.

func (*Reception) String

func (r *Reception) String() string

String implements the fmt.Stringer.

func (*Reception) Unwrap

func (r *Reception) Unwrap() *Reception

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

func (r *Reception) Update() *ReceptionUpdateOne

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

func (*Reception) Value

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

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

type ReceptionClient

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

ReceptionClient is a client for the Reception schema.

func NewReceptionClient

func NewReceptionClient(c config) *ReceptionClient

NewReceptionClient returns a client for the Reception from the given config.

func (*ReceptionClient) Create

func (c *ReceptionClient) Create() *ReceptionCreate

Create returns a builder for creating a Reception entity.

func (*ReceptionClient) CreateBulk

func (c *ReceptionClient) CreateBulk(builders ...*ReceptionCreate) *ReceptionCreateBulk

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

func (*ReceptionClient) Delete

func (c *ReceptionClient) Delete() *ReceptionDelete

Delete returns a delete builder for Reception.

func (*ReceptionClient) DeleteOne

func (c *ReceptionClient) DeleteOne(r *Reception) *ReceptionDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ReceptionClient) DeleteOneID

func (c *ReceptionClient) DeleteOneID(id int) *ReceptionDeleteOne

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

func (*ReceptionClient) Get

func (c *ReceptionClient) Get(ctx context.Context, id int) (*Reception, error)

Get returns a Reception entity by its id.

func (*ReceptionClient) GetX

func (c *ReceptionClient) GetX(ctx context.Context, id int) *Reception

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

func (*ReceptionClient) Hooks

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

Hooks returns the client hooks.

func (*ReceptionClient) Intercept

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

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

func (*ReceptionClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ReceptionClient) Query

func (c *ReceptionClient) Query() *ReceptionQuery

Query returns a query builder for Reception.

func (*ReceptionClient) QueryPatient

func (c *ReceptionClient) QueryPatient(r *Reception) *PatientQuery

QueryPatient queries the patient edge of a Reception.

func (*ReceptionClient) QueryVisit

func (c *ReceptionClient) QueryVisit(r *Reception) *VisitQuery

QueryVisit queries the visit edge of a Reception.

func (*ReceptionClient) Update

func (c *ReceptionClient) Update() *ReceptionUpdate

Update returns an update builder for Reception.

func (*ReceptionClient) UpdateOne

func (c *ReceptionClient) UpdateOne(r *Reception) *ReceptionUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ReceptionClient) UpdateOneID

func (c *ReceptionClient) UpdateOneID(id int) *ReceptionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ReceptionClient) Use

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

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

type ReceptionCreate

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

ReceptionCreate is the builder for creating a Reception entity.

func (*ReceptionCreate) AddVisit

func (rc *ReceptionCreate) AddVisit(v ...*Visit) *ReceptionCreate

AddVisit adds the "visit" edges to the Visit entity.

func (*ReceptionCreate) AddVisitIDs

func (rc *ReceptionCreate) AddVisitIDs(ids ...int) *ReceptionCreate

AddVisitIDs adds the "visit" edge to the Visit entity by IDs.

func (*ReceptionCreate) Exec

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

Exec executes the query.

func (*ReceptionCreate) ExecX

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

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

func (*ReceptionCreate) Mutation

func (rc *ReceptionCreate) Mutation() *ReceptionMutation

Mutation returns the ReceptionMutation object of the builder.

func (*ReceptionCreate) Save

func (rc *ReceptionCreate) Save(ctx context.Context) (*Reception, error)

Save creates the Reception in the database.

func (*ReceptionCreate) SaveX

func (rc *ReceptionCreate) SaveX(ctx context.Context) *Reception

SaveX calls Save and panics if Save returns an error.

func (*ReceptionCreate) SetCreatedAt

func (rc *ReceptionCreate) SetCreatedAt(t time.Time) *ReceptionCreate

SetCreatedAt sets the "created_at" field.

func (*ReceptionCreate) SetDeletedAt

func (rc *ReceptionCreate) SetDeletedAt(t time.Time) *ReceptionCreate

SetDeletedAt sets the "deleted_at" field.

func (*ReceptionCreate) SetDescription

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

SetDescription sets the "description" field.

func (*ReceptionCreate) SetInsuranceCode

func (rc *ReceptionCreate) SetInsuranceCode(s string) *ReceptionCreate

SetInsuranceCode sets the "insurance_code" field.

func (*ReceptionCreate) SetNillableCreatedAt

func (rc *ReceptionCreate) SetNillableCreatedAt(t *time.Time) *ReceptionCreate

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

func (*ReceptionCreate) SetNillableDeletedAt

func (rc *ReceptionCreate) SetNillableDeletedAt(t *time.Time) *ReceptionCreate

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

func (*ReceptionCreate) SetNillableDescription

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

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

func (*ReceptionCreate) SetNillableInsuranceCode

func (rc *ReceptionCreate) SetNillableInsuranceCode(s *string) *ReceptionCreate

SetNillableInsuranceCode sets the "insurance_code" field if the given value is not nil.

func (*ReceptionCreate) SetNillablePatientID

func (rc *ReceptionCreate) SetNillablePatientID(id *int) *ReceptionCreate

SetNillablePatientID sets the "patient" edge to the Patient entity by ID if the given value is not nil.

func (*ReceptionCreate) SetNillableUpdatedAt

func (rc *ReceptionCreate) SetNillableUpdatedAt(t *time.Time) *ReceptionCreate

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

func (*ReceptionCreate) SetPatient

func (rc *ReceptionCreate) SetPatient(p *Patient) *ReceptionCreate

SetPatient sets the "patient" edge to the Patient entity.

func (*ReceptionCreate) SetPatientID

func (rc *ReceptionCreate) SetPatientID(id int) *ReceptionCreate

SetPatientID sets the "patient" edge to the Patient entity by ID.

func (*ReceptionCreate) SetReceptionFor

func (rc *ReceptionCreate) SetReceptionFor(t time.Time) *ReceptionCreate

SetReceptionFor sets the "reception_for" field.

func (*ReceptionCreate) SetUpdatedAt

func (rc *ReceptionCreate) SetUpdatedAt(t time.Time) *ReceptionCreate

SetUpdatedAt sets the "updated_at" field.

func (*ReceptionCreate) SetVisitDuration

func (rc *ReceptionCreate) SetVisitDuration(i int) *ReceptionCreate

SetVisitDuration sets the "visit_duration" field.

type ReceptionCreateBulk

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

ReceptionCreateBulk is the builder for creating many Reception entities in bulk.

func (*ReceptionCreateBulk) Exec

func (rcb *ReceptionCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ReceptionCreateBulk) ExecX

func (rcb *ReceptionCreateBulk) ExecX(ctx context.Context)

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

func (*ReceptionCreateBulk) Save

func (rcb *ReceptionCreateBulk) Save(ctx context.Context) ([]*Reception, error)

Save creates the Reception entities in the database.

func (*ReceptionCreateBulk) SaveX

func (rcb *ReceptionCreateBulk) SaveX(ctx context.Context) []*Reception

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

type ReceptionDelete

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

ReceptionDelete is the builder for deleting a Reception entity.

func (*ReceptionDelete) Exec

func (rd *ReceptionDelete) Exec(ctx context.Context) (int, error)

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

func (*ReceptionDelete) ExecX

func (rd *ReceptionDelete) ExecX(ctx context.Context) int

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

func (*ReceptionDelete) Where

Where appends a list predicates to the ReceptionDelete builder.

type ReceptionDeleteOne

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

ReceptionDeleteOne is the builder for deleting a single Reception entity.

func (*ReceptionDeleteOne) Exec

func (rdo *ReceptionDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ReceptionDeleteOne) ExecX

func (rdo *ReceptionDeleteOne) ExecX(ctx context.Context)

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

func (*ReceptionDeleteOne) Where

Where appends a list predicates to the ReceptionDelete builder.

type ReceptionEdges

type ReceptionEdges struct {
	// Patient holds the value of the patient edge.
	Patient *Patient `json:"patient,omitempty"`
	// Visit holds the value of the visit edge.
	Visit []*Visit `json:"visit,omitempty"`
	// contains filtered or unexported fields
}

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

func (ReceptionEdges) PatientOrErr

func (e ReceptionEdges) PatientOrErr() (*Patient, error)

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

func (ReceptionEdges) VisitOrErr

func (e ReceptionEdges) VisitOrErr() ([]*Visit, error)

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

type ReceptionGroupBy

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

ReceptionGroupBy is the group-by builder for Reception entities.

func (*ReceptionGroupBy) Aggregate

func (rgb *ReceptionGroupBy) Aggregate(fns ...AggregateFunc) *ReceptionGroupBy

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

func (*ReceptionGroupBy) Bool

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

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

func (*ReceptionGroupBy) BoolX

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

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

func (*ReceptionGroupBy) Bools

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

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

func (*ReceptionGroupBy) BoolsX

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

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

func (*ReceptionGroupBy) Float64

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

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

func (*ReceptionGroupBy) Float64X

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

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

func (*ReceptionGroupBy) Float64s

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

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

func (*ReceptionGroupBy) Float64sX

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

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

func (*ReceptionGroupBy) Int

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

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

func (*ReceptionGroupBy) IntX

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

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

func (*ReceptionGroupBy) Ints

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

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

func (*ReceptionGroupBy) IntsX

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

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

func (*ReceptionGroupBy) Scan

func (rgb *ReceptionGroupBy) Scan(ctx context.Context, v any) error

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

func (*ReceptionGroupBy) ScanX

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

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

func (*ReceptionGroupBy) String

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

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

func (*ReceptionGroupBy) StringX

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

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

func (*ReceptionGroupBy) Strings

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

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

func (*ReceptionGroupBy) StringsX

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

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

type ReceptionMutation

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

ReceptionMutation represents an operation that mutates the Reception nodes in the graph.

func (*ReceptionMutation) AddField

func (m *ReceptionMutation) 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 (*ReceptionMutation) AddVisitDuration

func (m *ReceptionMutation) AddVisitDuration(i int)

AddVisitDuration adds i to the "visit_duration" field.

func (*ReceptionMutation) AddVisitIDs

func (m *ReceptionMutation) AddVisitIDs(ids ...int)

AddVisitIDs adds the "visit" edge to the Visit entity by ids.

func (*ReceptionMutation) AddedEdges

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

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

func (*ReceptionMutation) AddedField

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

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

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

func (*ReceptionMutation) AddedIDs

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

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

func (*ReceptionMutation) AddedVisitDuration

func (m *ReceptionMutation) AddedVisitDuration() (r int, exists bool)

AddedVisitDuration returns the value that was added to the "visit_duration" field in this mutation.

func (*ReceptionMutation) ClearDeletedAt

func (m *ReceptionMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*ReceptionMutation) ClearDescription

func (m *ReceptionMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*ReceptionMutation) ClearEdge

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

func (m *ReceptionMutation) 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 (*ReceptionMutation) ClearInsuranceCode

func (m *ReceptionMutation) ClearInsuranceCode()

ClearInsuranceCode clears the value of the "insurance_code" field.

func (*ReceptionMutation) ClearPatient

func (m *ReceptionMutation) ClearPatient()

ClearPatient clears the "patient" edge to the Patient entity.

func (*ReceptionMutation) ClearUpdatedAt

func (m *ReceptionMutation) ClearUpdatedAt()

ClearUpdatedAt clears the value of the "updated_at" field.

func (*ReceptionMutation) ClearVisit

func (m *ReceptionMutation) ClearVisit()

ClearVisit clears the "visit" edge to the Visit entity.

func (*ReceptionMutation) ClearedEdges

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

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

func (*ReceptionMutation) ClearedFields

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

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

func (ReceptionMutation) Client

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

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

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

func (*ReceptionMutation) DeletedAt

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

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

func (*ReceptionMutation) DeletedAtCleared

func (m *ReceptionMutation) DeletedAtCleared() bool

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

func (*ReceptionMutation) Description

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

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

func (*ReceptionMutation) DescriptionCleared

func (m *ReceptionMutation) DescriptionCleared() bool

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

func (*ReceptionMutation) EdgeCleared

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

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

func (*ReceptionMutation) Field

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

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

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

func (*ReceptionMutation) Fields

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

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

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

func (*ReceptionMutation) IDs

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

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

func (*ReceptionMutation) InsuranceCode

func (m *ReceptionMutation) InsuranceCode() (r string, exists bool)

InsuranceCode returns the value of the "insurance_code" field in the mutation.

func (*ReceptionMutation) InsuranceCodeCleared

func (m *ReceptionMutation) InsuranceCodeCleared() bool

InsuranceCodeCleared returns if the "insurance_code" field was cleared in this mutation.

func (*ReceptionMutation) OldCreatedAt

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

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

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

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

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

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

func (m *ReceptionMutation) 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 (*ReceptionMutation) OldInsuranceCode

func (m *ReceptionMutation) OldInsuranceCode(ctx context.Context) (v string, err error)

OldInsuranceCode returns the old "insurance_code" field's value of the Reception entity. If the Reception 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 (*ReceptionMutation) OldReceptionFor

func (m *ReceptionMutation) OldReceptionFor(ctx context.Context) (v time.Time, err error)

OldReceptionFor returns the old "reception_for" field's value of the Reception entity. If the Reception 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 (*ReceptionMutation) OldUpdatedAt

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

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

func (m *ReceptionMutation) OldVisitDuration(ctx context.Context) (v int, err error)

OldVisitDuration returns the old "visit_duration" field's value of the Reception entity. If the Reception 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 (*ReceptionMutation) Op

func (m *ReceptionMutation) Op() Op

Op returns the operation name.

func (*ReceptionMutation) PatientCleared

func (m *ReceptionMutation) PatientCleared() bool

PatientCleared reports if the "patient" edge to the Patient entity was cleared.

func (*ReceptionMutation) PatientID

func (m *ReceptionMutation) PatientID() (id int, exists bool)

PatientID returns the "patient" edge ID in the mutation.

func (*ReceptionMutation) PatientIDs

func (m *ReceptionMutation) PatientIDs() (ids []int)

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

func (*ReceptionMutation) ReceptionFor

func (m *ReceptionMutation) ReceptionFor() (r time.Time, exists bool)

ReceptionFor returns the value of the "reception_for" field in the mutation.

func (*ReceptionMutation) RemoveVisitIDs

func (m *ReceptionMutation) RemoveVisitIDs(ids ...int)

RemoveVisitIDs removes the "visit" edge to the Visit entity by IDs.

func (*ReceptionMutation) RemovedEdges

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

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

func (*ReceptionMutation) RemovedIDs

func (m *ReceptionMutation) 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 (*ReceptionMutation) RemovedVisitIDs

func (m *ReceptionMutation) RemovedVisitIDs() (ids []int)

RemovedVisit returns the removed IDs of the "visit" edge to the Visit entity.

func (*ReceptionMutation) ResetCreatedAt

func (m *ReceptionMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ReceptionMutation) ResetDeletedAt

func (m *ReceptionMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*ReceptionMutation) ResetDescription

func (m *ReceptionMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*ReceptionMutation) ResetEdge

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

func (m *ReceptionMutation) 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 (*ReceptionMutation) ResetInsuranceCode

func (m *ReceptionMutation) ResetInsuranceCode()

ResetInsuranceCode resets all changes to the "insurance_code" field.

func (*ReceptionMutation) ResetPatient

func (m *ReceptionMutation) ResetPatient()

ResetPatient resets all changes to the "patient" edge.

func (*ReceptionMutation) ResetReceptionFor

func (m *ReceptionMutation) ResetReceptionFor()

ResetReceptionFor resets all changes to the "reception_for" field.

func (*ReceptionMutation) ResetUpdatedAt

func (m *ReceptionMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*ReceptionMutation) ResetVisit

func (m *ReceptionMutation) ResetVisit()

ResetVisit resets all changes to the "visit" edge.

func (*ReceptionMutation) ResetVisitDuration

func (m *ReceptionMutation) ResetVisitDuration()

ResetVisitDuration resets all changes to the "visit_duration" field.

func (*ReceptionMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*ReceptionMutation) SetDeletedAt

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

SetDeletedAt sets the "deleted_at" field.

func (*ReceptionMutation) SetDescription

func (m *ReceptionMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*ReceptionMutation) SetField

func (m *ReceptionMutation) 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 (*ReceptionMutation) SetInsuranceCode

func (m *ReceptionMutation) SetInsuranceCode(s string)

SetInsuranceCode sets the "insurance_code" field.

func (*ReceptionMutation) SetOp

func (m *ReceptionMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ReceptionMutation) SetPatientID

func (m *ReceptionMutation) SetPatientID(id int)

SetPatientID sets the "patient" edge to the Patient entity by id.

func (*ReceptionMutation) SetReceptionFor

func (m *ReceptionMutation) SetReceptionFor(t time.Time)

SetReceptionFor sets the "reception_for" field.

func (*ReceptionMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*ReceptionMutation) SetVisitDuration

func (m *ReceptionMutation) SetVisitDuration(i int)

SetVisitDuration sets the "visit_duration" field.

func (ReceptionMutation) Tx

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

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

func (*ReceptionMutation) Type

func (m *ReceptionMutation) Type() string

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

func (*ReceptionMutation) UpdatedAt

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

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

func (*ReceptionMutation) UpdatedAtCleared

func (m *ReceptionMutation) UpdatedAtCleared() bool

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

func (*ReceptionMutation) VisitCleared

func (m *ReceptionMutation) VisitCleared() bool

VisitCleared reports if the "visit" edge to the Visit entity was cleared.

func (*ReceptionMutation) VisitDuration

func (m *ReceptionMutation) VisitDuration() (r int, exists bool)

VisitDuration returns the value of the "visit_duration" field in the mutation.

func (*ReceptionMutation) VisitIDs

func (m *ReceptionMutation) VisitIDs() (ids []int)

VisitIDs returns the "visit" edge IDs in the mutation.

func (*ReceptionMutation) Where

func (m *ReceptionMutation) Where(ps ...predicate.Reception)

Where appends a list predicates to the ReceptionMutation builder.

func (*ReceptionMutation) WhereP

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

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

type ReceptionQuery

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

ReceptionQuery is the builder for querying Reception entities.

func (*ReceptionQuery) Aggregate

func (rq *ReceptionQuery) Aggregate(fns ...AggregateFunc) *ReceptionSelect

Aggregate returns a ReceptionSelect configured with the given aggregations.

func (*ReceptionQuery) All

func (rq *ReceptionQuery) All(ctx context.Context) ([]*Reception, error)

All executes the query and returns a list of Receptions.

func (*ReceptionQuery) AllX

func (rq *ReceptionQuery) AllX(ctx context.Context) []*Reception

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

func (*ReceptionQuery) Clone

func (rq *ReceptionQuery) Clone() *ReceptionQuery

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

func (*ReceptionQuery) Count

func (rq *ReceptionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ReceptionQuery) CountX

func (rq *ReceptionQuery) CountX(ctx context.Context) int

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

func (*ReceptionQuery) Exist

func (rq *ReceptionQuery) Exist(ctx context.Context) (bool, error)

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

func (*ReceptionQuery) ExistX

func (rq *ReceptionQuery) ExistX(ctx context.Context) bool

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

func (*ReceptionQuery) First

func (rq *ReceptionQuery) First(ctx context.Context) (*Reception, error)

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

func (*ReceptionQuery) FirstID

func (rq *ReceptionQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*ReceptionQuery) FirstIDX

func (rq *ReceptionQuery) FirstIDX(ctx context.Context) int

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

func (*ReceptionQuery) FirstX

func (rq *ReceptionQuery) FirstX(ctx context.Context) *Reception

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

func (*ReceptionQuery) GroupBy

func (rq *ReceptionQuery) GroupBy(field string, fields ...string) *ReceptionGroupBy

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

client.Reception.Query().
	GroupBy(reception.FieldReceptionFor).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ReceptionQuery) IDs

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

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

func (*ReceptionQuery) IDsX

func (rq *ReceptionQuery) IDsX(ctx context.Context) []int

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

func (*ReceptionQuery) Limit

func (rq *ReceptionQuery) Limit(limit int) *ReceptionQuery

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

func (*ReceptionQuery) Offset

func (rq *ReceptionQuery) Offset(offset int) *ReceptionQuery

Offset to start from.

func (*ReceptionQuery) Only

func (rq *ReceptionQuery) Only(ctx context.Context) (*Reception, error)

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

func (*ReceptionQuery) OnlyID

func (rq *ReceptionQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*ReceptionQuery) OnlyIDX

func (rq *ReceptionQuery) OnlyIDX(ctx context.Context) int

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

func (*ReceptionQuery) OnlyX

func (rq *ReceptionQuery) OnlyX(ctx context.Context) *Reception

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

func (*ReceptionQuery) Order

Order specifies how the records should be ordered.

func (*ReceptionQuery) QueryPatient

func (rq *ReceptionQuery) QueryPatient() *PatientQuery

QueryPatient chains the current query on the "patient" edge.

func (*ReceptionQuery) QueryVisit

func (rq *ReceptionQuery) QueryVisit() *VisitQuery

QueryVisit chains the current query on the "visit" edge.

func (*ReceptionQuery) Select

func (rq *ReceptionQuery) Select(fields ...string) *ReceptionSelect

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

client.Reception.Query().
	Select(reception.FieldReceptionFor).
	Scan(ctx, &v)

func (*ReceptionQuery) Unique

func (rq *ReceptionQuery) Unique(unique bool) *ReceptionQuery

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

Where adds a new predicate for the ReceptionQuery builder.

func (*ReceptionQuery) WithPatient

func (rq *ReceptionQuery) WithPatient(opts ...func(*PatientQuery)) *ReceptionQuery

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

func (*ReceptionQuery) WithVisit

func (rq *ReceptionQuery) WithVisit(opts ...func(*VisitQuery)) *ReceptionQuery

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

type ReceptionSelect

type ReceptionSelect struct {
	*ReceptionQuery
	// contains filtered or unexported fields
}

ReceptionSelect is the builder for selecting fields of Reception entities.

func (*ReceptionSelect) Aggregate

func (rs *ReceptionSelect) Aggregate(fns ...AggregateFunc) *ReceptionSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ReceptionSelect) Bool

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

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

func (*ReceptionSelect) BoolX

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

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

func (*ReceptionSelect) Bools

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

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

func (*ReceptionSelect) BoolsX

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

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

func (*ReceptionSelect) Float64

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

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

func (*ReceptionSelect) Float64X

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

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

func (*ReceptionSelect) Float64s

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

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

func (*ReceptionSelect) Float64sX

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

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

func (*ReceptionSelect) Int

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

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

func (*ReceptionSelect) IntX

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

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

func (*ReceptionSelect) Ints

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

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

func (*ReceptionSelect) IntsX

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

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

func (*ReceptionSelect) Scan

func (rs *ReceptionSelect) Scan(ctx context.Context, v any) error

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

func (*ReceptionSelect) ScanX

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

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

func (*ReceptionSelect) String

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

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

func (*ReceptionSelect) StringX

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

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

func (*ReceptionSelect) Strings

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

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

func (*ReceptionSelect) StringsX

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

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

type ReceptionUpdate

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

ReceptionUpdate is the builder for updating Reception entities.

func (*ReceptionUpdate) AddVisit

func (ru *ReceptionUpdate) AddVisit(v ...*Visit) *ReceptionUpdate

AddVisit adds the "visit" edges to the Visit entity.

func (*ReceptionUpdate) AddVisitDuration

func (ru *ReceptionUpdate) AddVisitDuration(i int) *ReceptionUpdate

AddVisitDuration adds i to the "visit_duration" field.

func (*ReceptionUpdate) AddVisitIDs

func (ru *ReceptionUpdate) AddVisitIDs(ids ...int) *ReceptionUpdate

AddVisitIDs adds the "visit" edge to the Visit entity by IDs.

func (*ReceptionUpdate) ClearDeletedAt

func (ru *ReceptionUpdate) ClearDeletedAt() *ReceptionUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*ReceptionUpdate) ClearDescription

func (ru *ReceptionUpdate) ClearDescription() *ReceptionUpdate

ClearDescription clears the value of the "description" field.

func (*ReceptionUpdate) ClearInsuranceCode

func (ru *ReceptionUpdate) ClearInsuranceCode() *ReceptionUpdate

ClearInsuranceCode clears the value of the "insurance_code" field.

func (*ReceptionUpdate) ClearPatient

func (ru *ReceptionUpdate) ClearPatient() *ReceptionUpdate

ClearPatient clears the "patient" edge to the Patient entity.

func (*ReceptionUpdate) ClearUpdatedAt

func (ru *ReceptionUpdate) ClearUpdatedAt() *ReceptionUpdate

ClearUpdatedAt clears the value of the "updated_at" field.

func (*ReceptionUpdate) ClearVisit

func (ru *ReceptionUpdate) ClearVisit() *ReceptionUpdate

ClearVisit clears all "visit" edges to the Visit entity.

func (*ReceptionUpdate) Exec

func (ru *ReceptionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ReceptionUpdate) ExecX

func (ru *ReceptionUpdate) ExecX(ctx context.Context)

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

func (*ReceptionUpdate) Mutation

func (ru *ReceptionUpdate) Mutation() *ReceptionMutation

Mutation returns the ReceptionMutation object of the builder.

func (*ReceptionUpdate) RemoveVisit

func (ru *ReceptionUpdate) RemoveVisit(v ...*Visit) *ReceptionUpdate

RemoveVisit removes "visit" edges to Visit entities.

func (*ReceptionUpdate) RemoveVisitIDs

func (ru *ReceptionUpdate) RemoveVisitIDs(ids ...int) *ReceptionUpdate

RemoveVisitIDs removes the "visit" edge to Visit entities by IDs.

func (*ReceptionUpdate) Save

func (ru *ReceptionUpdate) Save(ctx context.Context) (int, error)

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

func (*ReceptionUpdate) SaveX

func (ru *ReceptionUpdate) SaveX(ctx context.Context) int

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

func (*ReceptionUpdate) SetCreatedAt

func (ru *ReceptionUpdate) SetCreatedAt(t time.Time) *ReceptionUpdate

SetCreatedAt sets the "created_at" field.

func (*ReceptionUpdate) SetDeletedAt

func (ru *ReceptionUpdate) SetDeletedAt(t time.Time) *ReceptionUpdate

SetDeletedAt sets the "deleted_at" field.

func (*ReceptionUpdate) SetDescription

func (ru *ReceptionUpdate) SetDescription(s string) *ReceptionUpdate

SetDescription sets the "description" field.

func (*ReceptionUpdate) SetInsuranceCode

func (ru *ReceptionUpdate) SetInsuranceCode(s string) *ReceptionUpdate

SetInsuranceCode sets the "insurance_code" field.

func (*ReceptionUpdate) SetNillableCreatedAt

func (ru *ReceptionUpdate) SetNillableCreatedAt(t *time.Time) *ReceptionUpdate

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

func (*ReceptionUpdate) SetNillableDeletedAt

func (ru *ReceptionUpdate) SetNillableDeletedAt(t *time.Time) *ReceptionUpdate

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

func (*ReceptionUpdate) SetNillableDescription

func (ru *ReceptionUpdate) SetNillableDescription(s *string) *ReceptionUpdate

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

func (*ReceptionUpdate) SetNillableInsuranceCode

func (ru *ReceptionUpdate) SetNillableInsuranceCode(s *string) *ReceptionUpdate

SetNillableInsuranceCode sets the "insurance_code" field if the given value is not nil.

func (*ReceptionUpdate) SetNillablePatientID

func (ru *ReceptionUpdate) SetNillablePatientID(id *int) *ReceptionUpdate

SetNillablePatientID sets the "patient" edge to the Patient entity by ID if the given value is not nil.

func (*ReceptionUpdate) SetNillableUpdatedAt

func (ru *ReceptionUpdate) SetNillableUpdatedAt(t *time.Time) *ReceptionUpdate

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

func (*ReceptionUpdate) SetPatient

func (ru *ReceptionUpdate) SetPatient(p *Patient) *ReceptionUpdate

SetPatient sets the "patient" edge to the Patient entity.

func (*ReceptionUpdate) SetPatientID

func (ru *ReceptionUpdate) SetPatientID(id int) *ReceptionUpdate

SetPatientID sets the "patient" edge to the Patient entity by ID.

func (*ReceptionUpdate) SetReceptionFor

func (ru *ReceptionUpdate) SetReceptionFor(t time.Time) *ReceptionUpdate

SetReceptionFor sets the "reception_for" field.

func (*ReceptionUpdate) SetUpdatedAt

func (ru *ReceptionUpdate) SetUpdatedAt(t time.Time) *ReceptionUpdate

SetUpdatedAt sets the "updated_at" field.

func (*ReceptionUpdate) SetVisitDuration

func (ru *ReceptionUpdate) SetVisitDuration(i int) *ReceptionUpdate

SetVisitDuration sets the "visit_duration" field.

func (*ReceptionUpdate) Where

Where appends a list predicates to the ReceptionUpdate builder.

type ReceptionUpdateOne

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

ReceptionUpdateOne is the builder for updating a single Reception entity.

func (*ReceptionUpdateOne) AddVisit

func (ruo *ReceptionUpdateOne) AddVisit(v ...*Visit) *ReceptionUpdateOne

AddVisit adds the "visit" edges to the Visit entity.

func (*ReceptionUpdateOne) AddVisitDuration

func (ruo *ReceptionUpdateOne) AddVisitDuration(i int) *ReceptionUpdateOne

AddVisitDuration adds i to the "visit_duration" field.

func (*ReceptionUpdateOne) AddVisitIDs

func (ruo *ReceptionUpdateOne) AddVisitIDs(ids ...int) *ReceptionUpdateOne

AddVisitIDs adds the "visit" edge to the Visit entity by IDs.

func (*ReceptionUpdateOne) ClearDeletedAt

func (ruo *ReceptionUpdateOne) ClearDeletedAt() *ReceptionUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*ReceptionUpdateOne) ClearDescription

func (ruo *ReceptionUpdateOne) ClearDescription() *ReceptionUpdateOne

ClearDescription clears the value of the "description" field.

func (*ReceptionUpdateOne) ClearInsuranceCode

func (ruo *ReceptionUpdateOne) ClearInsuranceCode() *ReceptionUpdateOne

ClearInsuranceCode clears the value of the "insurance_code" field.

func (*ReceptionUpdateOne) ClearPatient

func (ruo *ReceptionUpdateOne) ClearPatient() *ReceptionUpdateOne

ClearPatient clears the "patient" edge to the Patient entity.

func (*ReceptionUpdateOne) ClearUpdatedAt

func (ruo *ReceptionUpdateOne) ClearUpdatedAt() *ReceptionUpdateOne

ClearUpdatedAt clears the value of the "updated_at" field.

func (*ReceptionUpdateOne) ClearVisit

func (ruo *ReceptionUpdateOne) ClearVisit() *ReceptionUpdateOne

ClearVisit clears all "visit" edges to the Visit entity.

func (*ReceptionUpdateOne) Exec

func (ruo *ReceptionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ReceptionUpdateOne) ExecX

func (ruo *ReceptionUpdateOne) ExecX(ctx context.Context)

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

func (*ReceptionUpdateOne) Mutation

func (ruo *ReceptionUpdateOne) Mutation() *ReceptionMutation

Mutation returns the ReceptionMutation object of the builder.

func (*ReceptionUpdateOne) RemoveVisit

func (ruo *ReceptionUpdateOne) RemoveVisit(v ...*Visit) *ReceptionUpdateOne

RemoveVisit removes "visit" edges to Visit entities.

func (*ReceptionUpdateOne) RemoveVisitIDs

func (ruo *ReceptionUpdateOne) RemoveVisitIDs(ids ...int) *ReceptionUpdateOne

RemoveVisitIDs removes the "visit" edge to Visit entities by IDs.

func (*ReceptionUpdateOne) Save

func (ruo *ReceptionUpdateOne) Save(ctx context.Context) (*Reception, error)

Save executes the query and returns the updated Reception entity.

func (*ReceptionUpdateOne) SaveX

func (ruo *ReceptionUpdateOne) SaveX(ctx context.Context) *Reception

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

func (*ReceptionUpdateOne) Select

func (ruo *ReceptionUpdateOne) Select(field string, fields ...string) *ReceptionUpdateOne

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

func (*ReceptionUpdateOne) SetCreatedAt

func (ruo *ReceptionUpdateOne) SetCreatedAt(t time.Time) *ReceptionUpdateOne

SetCreatedAt sets the "created_at" field.

func (*ReceptionUpdateOne) SetDeletedAt

func (ruo *ReceptionUpdateOne) SetDeletedAt(t time.Time) *ReceptionUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*ReceptionUpdateOne) SetDescription

func (ruo *ReceptionUpdateOne) SetDescription(s string) *ReceptionUpdateOne

SetDescription sets the "description" field.

func (*ReceptionUpdateOne) SetInsuranceCode

func (ruo *ReceptionUpdateOne) SetInsuranceCode(s string) *ReceptionUpdateOne

SetInsuranceCode sets the "insurance_code" field.

func (*ReceptionUpdateOne) SetNillableCreatedAt

func (ruo *ReceptionUpdateOne) SetNillableCreatedAt(t *time.Time) *ReceptionUpdateOne

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

func (*ReceptionUpdateOne) SetNillableDeletedAt

func (ruo *ReceptionUpdateOne) SetNillableDeletedAt(t *time.Time) *ReceptionUpdateOne

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

func (*ReceptionUpdateOne) SetNillableDescription

func (ruo *ReceptionUpdateOne) SetNillableDescription(s *string) *ReceptionUpdateOne

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

func (*ReceptionUpdateOne) SetNillableInsuranceCode

func (ruo *ReceptionUpdateOne) SetNillableInsuranceCode(s *string) *ReceptionUpdateOne

SetNillableInsuranceCode sets the "insurance_code" field if the given value is not nil.

func (*ReceptionUpdateOne) SetNillablePatientID

func (ruo *ReceptionUpdateOne) SetNillablePatientID(id *int) *ReceptionUpdateOne

SetNillablePatientID sets the "patient" edge to the Patient entity by ID if the given value is not nil.

func (*ReceptionUpdateOne) SetNillableUpdatedAt

func (ruo *ReceptionUpdateOne) SetNillableUpdatedAt(t *time.Time) *ReceptionUpdateOne

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

func (*ReceptionUpdateOne) SetPatient

func (ruo *ReceptionUpdateOne) SetPatient(p *Patient) *ReceptionUpdateOne

SetPatient sets the "patient" edge to the Patient entity.

func (*ReceptionUpdateOne) SetPatientID

func (ruo *ReceptionUpdateOne) SetPatientID(id int) *ReceptionUpdateOne

SetPatientID sets the "patient" edge to the Patient entity by ID.

func (*ReceptionUpdateOne) SetReceptionFor

func (ruo *ReceptionUpdateOne) SetReceptionFor(t time.Time) *ReceptionUpdateOne

SetReceptionFor sets the "reception_for" field.

func (*ReceptionUpdateOne) SetUpdatedAt

func (ruo *ReceptionUpdateOne) SetUpdatedAt(t time.Time) *ReceptionUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*ReceptionUpdateOne) SetVisitDuration

func (ruo *ReceptionUpdateOne) SetVisitDuration(i int) *ReceptionUpdateOne

SetVisitDuration sets the "visit_duration" field.

func (*ReceptionUpdateOne) Where

Where appends a list predicates to the ReceptionUpdate builder.

type Receptions

type Receptions []*Reception

Receptions is a parsable slice of Reception.

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 {

	// Attachment is the client for interacting with the Attachment builders.
	Attachment *AttachmentClient
	// Patient is the client for interacting with the Patient builders.
	Patient *PatientClient
	// Reception is the client for interacting with the Reception builders.
	Reception *ReceptionClient
	// Visit is the client for interacting with the Visit builders.
	Visit *VisitClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

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

type Visit

type Visit struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// VisitPrice holds the value of the "visit_price" field.
	VisitPrice string `json:"visit_price,omitempty"`
	// VisitedAt holds the value of the "visited_at" field.
	VisitedAt time.Time `json:"visited_at,omitempty"`
	// PaymentType holds the value of the "payment_type" field.
	PaymentType string `json:"payment_type,omitempty"`
	// IsPaid holds the value of the "is_paid" field.
	IsPaid bool `json:"is_paid,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// DeletedAt holds the value of the "deleted_at" field.
	DeletedAt time.Time `json:"deleted_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the VisitQuery when eager-loading is set.
	Edges VisitEdges `json:"edges"`
	// contains filtered or unexported fields
}

Visit is the model entity for the Visit schema.

func (*Visit) QueryAttachment

func (v *Visit) QueryAttachment() *AttachmentQuery

QueryAttachment queries the "attachment" edge of the Visit entity.

func (*Visit) QueryReception

func (v *Visit) QueryReception() *ReceptionQuery

QueryReception queries the "reception" edge of the Visit entity.

func (*Visit) String

func (v *Visit) String() string

String implements the fmt.Stringer.

func (*Visit) Unwrap

func (v *Visit) Unwrap() *Visit

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

func (v *Visit) Update() *VisitUpdateOne

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

func (*Visit) Value

func (v *Visit) Value(name string) (ent.Value, error)

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

type VisitClient

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

VisitClient is a client for the Visit schema.

func NewVisitClient

func NewVisitClient(c config) *VisitClient

NewVisitClient returns a client for the Visit from the given config.

func (*VisitClient) Create

func (c *VisitClient) Create() *VisitCreate

Create returns a builder for creating a Visit entity.

func (*VisitClient) CreateBulk

func (c *VisitClient) CreateBulk(builders ...*VisitCreate) *VisitCreateBulk

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

func (*VisitClient) Delete

func (c *VisitClient) Delete() *VisitDelete

Delete returns a delete builder for Visit.

func (*VisitClient) DeleteOne

func (c *VisitClient) DeleteOne(v *Visit) *VisitDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*VisitClient) DeleteOneID

func (c *VisitClient) DeleteOneID(id int) *VisitDeleteOne

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

func (*VisitClient) Get

func (c *VisitClient) Get(ctx context.Context, id int) (*Visit, error)

Get returns a Visit entity by its id.

func (*VisitClient) GetX

func (c *VisitClient) GetX(ctx context.Context, id int) *Visit

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

func (*VisitClient) Hooks

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

Hooks returns the client hooks.

func (*VisitClient) Intercept

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

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

func (*VisitClient) Interceptors

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

Interceptors returns the client interceptors.

func (*VisitClient) Query

func (c *VisitClient) Query() *VisitQuery

Query returns a query builder for Visit.

func (*VisitClient) QueryAttachment

func (c *VisitClient) QueryAttachment(v *Visit) *AttachmentQuery

QueryAttachment queries the attachment edge of a Visit.

func (*VisitClient) QueryReception

func (c *VisitClient) QueryReception(v *Visit) *ReceptionQuery

QueryReception queries the reception edge of a Visit.

func (*VisitClient) Update

func (c *VisitClient) Update() *VisitUpdate

Update returns an update builder for Visit.

func (*VisitClient) UpdateOne

func (c *VisitClient) UpdateOne(v *Visit) *VisitUpdateOne

UpdateOne returns an update builder for the given entity.

func (*VisitClient) UpdateOneID

func (c *VisitClient) UpdateOneID(id int) *VisitUpdateOne

UpdateOneID returns an update builder for the given id.

func (*VisitClient) Use

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

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

type VisitCreate

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

VisitCreate is the builder for creating a Visit entity.

func (*VisitCreate) AddAttachment

func (vc *VisitCreate) AddAttachment(a ...*Attachment) *VisitCreate

AddAttachment adds the "attachment" edges to the Attachment entity.

func (*VisitCreate) AddAttachmentIDs

func (vc *VisitCreate) AddAttachmentIDs(ids ...int) *VisitCreate

AddAttachmentIDs adds the "attachment" edge to the Attachment entity by IDs.

func (*VisitCreate) Exec

func (vc *VisitCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*VisitCreate) ExecX

func (vc *VisitCreate) ExecX(ctx context.Context)

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

func (*VisitCreate) Mutation

func (vc *VisitCreate) Mutation() *VisitMutation

Mutation returns the VisitMutation object of the builder.

func (*VisitCreate) Save

func (vc *VisitCreate) Save(ctx context.Context) (*Visit, error)

Save creates the Visit in the database.

func (*VisitCreate) SaveX

func (vc *VisitCreate) SaveX(ctx context.Context) *Visit

SaveX calls Save and panics if Save returns an error.

func (*VisitCreate) SetCreatedAt

func (vc *VisitCreate) SetCreatedAt(t time.Time) *VisitCreate

SetCreatedAt sets the "created_at" field.

func (*VisitCreate) SetDeletedAt

func (vc *VisitCreate) SetDeletedAt(t time.Time) *VisitCreate

SetDeletedAt sets the "deleted_at" field.

func (*VisitCreate) SetIsPaid

func (vc *VisitCreate) SetIsPaid(b bool) *VisitCreate

SetIsPaid sets the "is_paid" field.

func (*VisitCreate) SetNillableCreatedAt

func (vc *VisitCreate) SetNillableCreatedAt(t *time.Time) *VisitCreate

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

func (*VisitCreate) SetNillableDeletedAt

func (vc *VisitCreate) SetNillableDeletedAt(t *time.Time) *VisitCreate

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

func (*VisitCreate) SetNillableIsPaid

func (vc *VisitCreate) SetNillableIsPaid(b *bool) *VisitCreate

SetNillableIsPaid sets the "is_paid" field if the given value is not nil.

func (*VisitCreate) SetNillablePaymentType

func (vc *VisitCreate) SetNillablePaymentType(s *string) *VisitCreate

SetNillablePaymentType sets the "payment_type" field if the given value is not nil.

func (*VisitCreate) SetNillableReceptionID

func (vc *VisitCreate) SetNillableReceptionID(id *int) *VisitCreate

SetNillableReceptionID sets the "reception" edge to the Reception entity by ID if the given value is not nil.

func (*VisitCreate) SetNillableUpdatedAt

func (vc *VisitCreate) SetNillableUpdatedAt(t *time.Time) *VisitCreate

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

func (*VisitCreate) SetNillableVisitPrice

func (vc *VisitCreate) SetNillableVisitPrice(s *string) *VisitCreate

SetNillableVisitPrice sets the "visit_price" field if the given value is not nil.

func (*VisitCreate) SetNillableVisitedAt

func (vc *VisitCreate) SetNillableVisitedAt(t *time.Time) *VisitCreate

SetNillableVisitedAt sets the "visited_at" field if the given value is not nil.

func (*VisitCreate) SetPaymentType

func (vc *VisitCreate) SetPaymentType(s string) *VisitCreate

SetPaymentType sets the "payment_type" field.

func (*VisitCreate) SetReception

func (vc *VisitCreate) SetReception(r *Reception) *VisitCreate

SetReception sets the "reception" edge to the Reception entity.

func (*VisitCreate) SetReceptionID

func (vc *VisitCreate) SetReceptionID(id int) *VisitCreate

SetReceptionID sets the "reception" edge to the Reception entity by ID.

func (*VisitCreate) SetUpdatedAt

func (vc *VisitCreate) SetUpdatedAt(t time.Time) *VisitCreate

SetUpdatedAt sets the "updated_at" field.

func (*VisitCreate) SetVisitPrice

func (vc *VisitCreate) SetVisitPrice(s string) *VisitCreate

SetVisitPrice sets the "visit_price" field.

func (*VisitCreate) SetVisitedAt

func (vc *VisitCreate) SetVisitedAt(t time.Time) *VisitCreate

SetVisitedAt sets the "visited_at" field.

type VisitCreateBulk

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

VisitCreateBulk is the builder for creating many Visit entities in bulk.

func (*VisitCreateBulk) Exec

func (vcb *VisitCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*VisitCreateBulk) ExecX

func (vcb *VisitCreateBulk) ExecX(ctx context.Context)

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

func (*VisitCreateBulk) Save

func (vcb *VisitCreateBulk) Save(ctx context.Context) ([]*Visit, error)

Save creates the Visit entities in the database.

func (*VisitCreateBulk) SaveX

func (vcb *VisitCreateBulk) SaveX(ctx context.Context) []*Visit

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

type VisitDelete

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

VisitDelete is the builder for deleting a Visit entity.

func (*VisitDelete) Exec

func (vd *VisitDelete) Exec(ctx context.Context) (int, error)

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

func (*VisitDelete) ExecX

func (vd *VisitDelete) ExecX(ctx context.Context) int

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

func (*VisitDelete) Where

func (vd *VisitDelete) Where(ps ...predicate.Visit) *VisitDelete

Where appends a list predicates to the VisitDelete builder.

type VisitDeleteOne

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

VisitDeleteOne is the builder for deleting a single Visit entity.

func (*VisitDeleteOne) Exec

func (vdo *VisitDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*VisitDeleteOne) ExecX

func (vdo *VisitDeleteOne) ExecX(ctx context.Context)

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

func (*VisitDeleteOne) Where

func (vdo *VisitDeleteOne) Where(ps ...predicate.Visit) *VisitDeleteOne

Where appends a list predicates to the VisitDelete builder.

type VisitEdges

type VisitEdges struct {
	// Reception holds the value of the reception edge.
	Reception *Reception `json:"reception,omitempty"`
	// Attachment holds the value of the attachment edge.
	Attachment []*Attachment `json:"attachment,omitempty"`
	// contains filtered or unexported fields
}

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

func (VisitEdges) AttachmentOrErr

func (e VisitEdges) AttachmentOrErr() ([]*Attachment, error)

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

func (VisitEdges) ReceptionOrErr

func (e VisitEdges) ReceptionOrErr() (*Reception, error)

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

type VisitGroupBy

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

VisitGroupBy is the group-by builder for Visit entities.

func (*VisitGroupBy) Aggregate

func (vgb *VisitGroupBy) Aggregate(fns ...AggregateFunc) *VisitGroupBy

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

func (*VisitGroupBy) Bool

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

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

func (*VisitGroupBy) BoolX

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

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

func (*VisitGroupBy) Bools

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

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

func (*VisitGroupBy) BoolsX

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

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

func (*VisitGroupBy) Float64

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

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

func (*VisitGroupBy) Float64X

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

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

func (*VisitGroupBy) Float64s

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

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

func (*VisitGroupBy) Float64sX

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

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

func (*VisitGroupBy) Int

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

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

func (*VisitGroupBy) IntX

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

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

func (*VisitGroupBy) Ints

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

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

func (*VisitGroupBy) IntsX

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

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

func (*VisitGroupBy) Scan

func (vgb *VisitGroupBy) Scan(ctx context.Context, v any) error

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

func (*VisitGroupBy) ScanX

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

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

func (*VisitGroupBy) String

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

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

func (*VisitGroupBy) StringX

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

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

func (*VisitGroupBy) Strings

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

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

func (*VisitGroupBy) StringsX

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

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

type VisitMutation

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

VisitMutation represents an operation that mutates the Visit nodes in the graph.

func (*VisitMutation) AddAttachmentIDs

func (m *VisitMutation) AddAttachmentIDs(ids ...int)

AddAttachmentIDs adds the "attachment" edge to the Attachment entity by ids.

func (*VisitMutation) AddField

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

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

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

func (*VisitMutation) AddedField

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

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

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

func (*VisitMutation) AddedIDs

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

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

func (*VisitMutation) AttachmentCleared

func (m *VisitMutation) AttachmentCleared() bool

AttachmentCleared reports if the "attachment" edge to the Attachment entity was cleared.

func (*VisitMutation) AttachmentIDs

func (m *VisitMutation) AttachmentIDs() (ids []int)

AttachmentIDs returns the "attachment" edge IDs in the mutation.

func (*VisitMutation) ClearAttachment

func (m *VisitMutation) ClearAttachment()

ClearAttachment clears the "attachment" edge to the Attachment entity.

func (*VisitMutation) ClearDeletedAt

func (m *VisitMutation) ClearDeletedAt()

ClearDeletedAt clears the value of the "deleted_at" field.

func (*VisitMutation) ClearEdge

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

func (m *VisitMutation) 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 (*VisitMutation) ClearIsPaid

func (m *VisitMutation) ClearIsPaid()

ClearIsPaid clears the value of the "is_paid" field.

func (*VisitMutation) ClearPaymentType

func (m *VisitMutation) ClearPaymentType()

ClearPaymentType clears the value of the "payment_type" field.

func (*VisitMutation) ClearReception

func (m *VisitMutation) ClearReception()

ClearReception clears the "reception" edge to the Reception entity.

func (*VisitMutation) ClearUpdatedAt

func (m *VisitMutation) ClearUpdatedAt()

ClearUpdatedAt clears the value of the "updated_at" field.

func (*VisitMutation) ClearVisitPrice

func (m *VisitMutation) ClearVisitPrice()

ClearVisitPrice clears the value of the "visit_price" field.

func (*VisitMutation) ClearVisitedAt

func (m *VisitMutation) ClearVisitedAt()

ClearVisitedAt clears the value of the "visited_at" field.

func (*VisitMutation) ClearedEdges

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

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

func (*VisitMutation) ClearedFields

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

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

func (VisitMutation) Client

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

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

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

func (*VisitMutation) DeletedAt

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

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

func (*VisitMutation) DeletedAtCleared

func (m *VisitMutation) DeletedAtCleared() bool

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

func (*VisitMutation) EdgeCleared

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

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

func (*VisitMutation) Field

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

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

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

func (*VisitMutation) Fields

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

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

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

func (*VisitMutation) IDs

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

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

func (*VisitMutation) IsPaid

func (m *VisitMutation) IsPaid() (r bool, exists bool)

IsPaid returns the value of the "is_paid" field in the mutation.

func (*VisitMutation) IsPaidCleared

func (m *VisitMutation) IsPaidCleared() bool

IsPaidCleared returns if the "is_paid" field was cleared in this mutation.

func (*VisitMutation) OldCreatedAt

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

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

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

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

func (m *VisitMutation) 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 (*VisitMutation) OldIsPaid

func (m *VisitMutation) OldIsPaid(ctx context.Context) (v bool, err error)

OldIsPaid returns the old "is_paid" field's value of the Visit entity. If the Visit 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 (*VisitMutation) OldPaymentType

func (m *VisitMutation) OldPaymentType(ctx context.Context) (v string, err error)

OldPaymentType returns the old "payment_type" field's value of the Visit entity. If the Visit 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 (*VisitMutation) OldUpdatedAt

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

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

func (m *VisitMutation) OldVisitPrice(ctx context.Context) (v string, err error)

OldVisitPrice returns the old "visit_price" field's value of the Visit entity. If the Visit 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 (*VisitMutation) OldVisitedAt

func (m *VisitMutation) OldVisitedAt(ctx context.Context) (v time.Time, err error)

OldVisitedAt returns the old "visited_at" field's value of the Visit entity. If the Visit 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 (*VisitMutation) Op

func (m *VisitMutation) Op() Op

Op returns the operation name.

func (*VisitMutation) PaymentType

func (m *VisitMutation) PaymentType() (r string, exists bool)

PaymentType returns the value of the "payment_type" field in the mutation.

func (*VisitMutation) PaymentTypeCleared

func (m *VisitMutation) PaymentTypeCleared() bool

PaymentTypeCleared returns if the "payment_type" field was cleared in this mutation.

func (*VisitMutation) ReceptionCleared

func (m *VisitMutation) ReceptionCleared() bool

ReceptionCleared reports if the "reception" edge to the Reception entity was cleared.

func (*VisitMutation) ReceptionID

func (m *VisitMutation) ReceptionID() (id int, exists bool)

ReceptionID returns the "reception" edge ID in the mutation.

func (*VisitMutation) ReceptionIDs

func (m *VisitMutation) ReceptionIDs() (ids []int)

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

func (*VisitMutation) RemoveAttachmentIDs

func (m *VisitMutation) RemoveAttachmentIDs(ids ...int)

RemoveAttachmentIDs removes the "attachment" edge to the Attachment entity by IDs.

func (*VisitMutation) RemovedAttachmentIDs

func (m *VisitMutation) RemovedAttachmentIDs() (ids []int)

RemovedAttachment returns the removed IDs of the "attachment" edge to the Attachment entity.

func (*VisitMutation) RemovedEdges

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

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

func (*VisitMutation) RemovedIDs

func (m *VisitMutation) 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 (*VisitMutation) ResetAttachment

func (m *VisitMutation) ResetAttachment()

ResetAttachment resets all changes to the "attachment" edge.

func (*VisitMutation) ResetCreatedAt

func (m *VisitMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*VisitMutation) ResetDeletedAt

func (m *VisitMutation) ResetDeletedAt()

ResetDeletedAt resets all changes to the "deleted_at" field.

func (*VisitMutation) ResetEdge

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

func (m *VisitMutation) 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 (*VisitMutation) ResetIsPaid

func (m *VisitMutation) ResetIsPaid()

ResetIsPaid resets all changes to the "is_paid" field.

func (*VisitMutation) ResetPaymentType

func (m *VisitMutation) ResetPaymentType()

ResetPaymentType resets all changes to the "payment_type" field.

func (*VisitMutation) ResetReception

func (m *VisitMutation) ResetReception()

ResetReception resets all changes to the "reception" edge.

func (*VisitMutation) ResetUpdatedAt

func (m *VisitMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*VisitMutation) ResetVisitPrice

func (m *VisitMutation) ResetVisitPrice()

ResetVisitPrice resets all changes to the "visit_price" field.

func (*VisitMutation) ResetVisitedAt

func (m *VisitMutation) ResetVisitedAt()

ResetVisitedAt resets all changes to the "visited_at" field.

func (*VisitMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*VisitMutation) SetDeletedAt

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

SetDeletedAt sets the "deleted_at" field.

func (*VisitMutation) SetField

func (m *VisitMutation) 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 (*VisitMutation) SetIsPaid

func (m *VisitMutation) SetIsPaid(b bool)

SetIsPaid sets the "is_paid" field.

func (*VisitMutation) SetOp

func (m *VisitMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*VisitMutation) SetPaymentType

func (m *VisitMutation) SetPaymentType(s string)

SetPaymentType sets the "payment_type" field.

func (*VisitMutation) SetReceptionID

func (m *VisitMutation) SetReceptionID(id int)

SetReceptionID sets the "reception" edge to the Reception entity by id.

func (*VisitMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*VisitMutation) SetVisitPrice

func (m *VisitMutation) SetVisitPrice(s string)

SetVisitPrice sets the "visit_price" field.

func (*VisitMutation) SetVisitedAt

func (m *VisitMutation) SetVisitedAt(t time.Time)

SetVisitedAt sets the "visited_at" field.

func (VisitMutation) Tx

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

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

func (*VisitMutation) Type

func (m *VisitMutation) Type() string

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

func (*VisitMutation) UpdatedAt

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

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

func (*VisitMutation) UpdatedAtCleared

func (m *VisitMutation) UpdatedAtCleared() bool

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

func (*VisitMutation) VisitPrice

func (m *VisitMutation) VisitPrice() (r string, exists bool)

VisitPrice returns the value of the "visit_price" field in the mutation.

func (*VisitMutation) VisitPriceCleared

func (m *VisitMutation) VisitPriceCleared() bool

VisitPriceCleared returns if the "visit_price" field was cleared in this mutation.

func (*VisitMutation) VisitedAt

func (m *VisitMutation) VisitedAt() (r time.Time, exists bool)

VisitedAt returns the value of the "visited_at" field in the mutation.

func (*VisitMutation) VisitedAtCleared

func (m *VisitMutation) VisitedAtCleared() bool

VisitedAtCleared returns if the "visited_at" field was cleared in this mutation.

func (*VisitMutation) Where

func (m *VisitMutation) Where(ps ...predicate.Visit)

Where appends a list predicates to the VisitMutation builder.

func (*VisitMutation) WhereP

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

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

type VisitQuery

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

VisitQuery is the builder for querying Visit entities.

func (*VisitQuery) Aggregate

func (vq *VisitQuery) Aggregate(fns ...AggregateFunc) *VisitSelect

Aggregate returns a VisitSelect configured with the given aggregations.

func (*VisitQuery) All

func (vq *VisitQuery) All(ctx context.Context) ([]*Visit, error)

All executes the query and returns a list of Visits.

func (*VisitQuery) AllX

func (vq *VisitQuery) AllX(ctx context.Context) []*Visit

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

func (*VisitQuery) Clone

func (vq *VisitQuery) Clone() *VisitQuery

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

func (*VisitQuery) Count

func (vq *VisitQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*VisitQuery) CountX

func (vq *VisitQuery) CountX(ctx context.Context) int

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

func (*VisitQuery) Exist

func (vq *VisitQuery) Exist(ctx context.Context) (bool, error)

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

func (*VisitQuery) ExistX

func (vq *VisitQuery) ExistX(ctx context.Context) bool

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

func (*VisitQuery) First

func (vq *VisitQuery) First(ctx context.Context) (*Visit, error)

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

func (*VisitQuery) FirstID

func (vq *VisitQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*VisitQuery) FirstIDX

func (vq *VisitQuery) FirstIDX(ctx context.Context) int

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

func (*VisitQuery) FirstX

func (vq *VisitQuery) FirstX(ctx context.Context) *Visit

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

func (*VisitQuery) GroupBy

func (vq *VisitQuery) GroupBy(field string, fields ...string) *VisitGroupBy

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

client.Visit.Query().
	GroupBy(visit.FieldVisitPrice).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*VisitQuery) IDs

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

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

func (*VisitQuery) IDsX

func (vq *VisitQuery) IDsX(ctx context.Context) []int

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

func (*VisitQuery) Limit

func (vq *VisitQuery) Limit(limit int) *VisitQuery

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

func (*VisitQuery) Offset

func (vq *VisitQuery) Offset(offset int) *VisitQuery

Offset to start from.

func (*VisitQuery) Only

func (vq *VisitQuery) Only(ctx context.Context) (*Visit, error)

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

func (*VisitQuery) OnlyID

func (vq *VisitQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*VisitQuery) OnlyIDX

func (vq *VisitQuery) OnlyIDX(ctx context.Context) int

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

func (*VisitQuery) OnlyX

func (vq *VisitQuery) OnlyX(ctx context.Context) *Visit

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

func (*VisitQuery) Order

func (vq *VisitQuery) Order(o ...visit.OrderOption) *VisitQuery

Order specifies how the records should be ordered.

func (*VisitQuery) QueryAttachment

func (vq *VisitQuery) QueryAttachment() *AttachmentQuery

QueryAttachment chains the current query on the "attachment" edge.

func (*VisitQuery) QueryReception

func (vq *VisitQuery) QueryReception() *ReceptionQuery

QueryReception chains the current query on the "reception" edge.

func (*VisitQuery) Select

func (vq *VisitQuery) Select(fields ...string) *VisitSelect

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

client.Visit.Query().
	Select(visit.FieldVisitPrice).
	Scan(ctx, &v)

func (*VisitQuery) Unique

func (vq *VisitQuery) Unique(unique bool) *VisitQuery

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

func (vq *VisitQuery) Where(ps ...predicate.Visit) *VisitQuery

Where adds a new predicate for the VisitQuery builder.

func (*VisitQuery) WithAttachment

func (vq *VisitQuery) WithAttachment(opts ...func(*AttachmentQuery)) *VisitQuery

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

func (*VisitQuery) WithReception

func (vq *VisitQuery) WithReception(opts ...func(*ReceptionQuery)) *VisitQuery

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

type VisitSelect

type VisitSelect struct {
	*VisitQuery
	// contains filtered or unexported fields
}

VisitSelect is the builder for selecting fields of Visit entities.

func (*VisitSelect) Aggregate

func (vs *VisitSelect) Aggregate(fns ...AggregateFunc) *VisitSelect

Aggregate adds the given aggregation functions to the selector query.

func (*VisitSelect) Bool

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

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

func (*VisitSelect) BoolX

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

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

func (*VisitSelect) Bools

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

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

func (*VisitSelect) BoolsX

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

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

func (*VisitSelect) Float64

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

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

func (*VisitSelect) Float64X

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

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

func (*VisitSelect) Float64s

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

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

func (*VisitSelect) Float64sX

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

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

func (*VisitSelect) Int

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

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

func (*VisitSelect) IntX

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

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

func (*VisitSelect) Ints

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

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

func (*VisitSelect) IntsX

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

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

func (*VisitSelect) Scan

func (vs *VisitSelect) Scan(ctx context.Context, v any) error

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

func (*VisitSelect) ScanX

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

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

func (*VisitSelect) String

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

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

func (*VisitSelect) StringX

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

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

func (*VisitSelect) Strings

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

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*VisitSelect) StringsX

func (s *VisitSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type VisitUpdate

type VisitUpdate struct {
	// contains filtered or unexported fields
}

VisitUpdate is the builder for updating Visit entities.

func (*VisitUpdate) AddAttachment

func (vu *VisitUpdate) AddAttachment(a ...*Attachment) *VisitUpdate

AddAttachment adds the "attachment" edges to the Attachment entity.

func (*VisitUpdate) AddAttachmentIDs

func (vu *VisitUpdate) AddAttachmentIDs(ids ...int) *VisitUpdate

AddAttachmentIDs adds the "attachment" edge to the Attachment entity by IDs.

func (*VisitUpdate) ClearAttachment

func (vu *VisitUpdate) ClearAttachment() *VisitUpdate

ClearAttachment clears all "attachment" edges to the Attachment entity.

func (*VisitUpdate) ClearDeletedAt

func (vu *VisitUpdate) ClearDeletedAt() *VisitUpdate

ClearDeletedAt clears the value of the "deleted_at" field.

func (*VisitUpdate) ClearIsPaid

func (vu *VisitUpdate) ClearIsPaid() *VisitUpdate

ClearIsPaid clears the value of the "is_paid" field.

func (*VisitUpdate) ClearPaymentType

func (vu *VisitUpdate) ClearPaymentType() *VisitUpdate

ClearPaymentType clears the value of the "payment_type" field.

func (*VisitUpdate) ClearReception

func (vu *VisitUpdate) ClearReception() *VisitUpdate

ClearReception clears the "reception" edge to the Reception entity.

func (*VisitUpdate) ClearUpdatedAt

func (vu *VisitUpdate) ClearUpdatedAt() *VisitUpdate

ClearUpdatedAt clears the value of the "updated_at" field.

func (*VisitUpdate) ClearVisitPrice

func (vu *VisitUpdate) ClearVisitPrice() *VisitUpdate

ClearVisitPrice clears the value of the "visit_price" field.

func (*VisitUpdate) ClearVisitedAt

func (vu *VisitUpdate) ClearVisitedAt() *VisitUpdate

ClearVisitedAt clears the value of the "visited_at" field.

func (*VisitUpdate) Exec

func (vu *VisitUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*VisitUpdate) ExecX

func (vu *VisitUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*VisitUpdate) Mutation

func (vu *VisitUpdate) Mutation() *VisitMutation

Mutation returns the VisitMutation object of the builder.

func (*VisitUpdate) RemoveAttachment

func (vu *VisitUpdate) RemoveAttachment(a ...*Attachment) *VisitUpdate

RemoveAttachment removes "attachment" edges to Attachment entities.

func (*VisitUpdate) RemoveAttachmentIDs

func (vu *VisitUpdate) RemoveAttachmentIDs(ids ...int) *VisitUpdate

RemoveAttachmentIDs removes the "attachment" edge to Attachment entities by IDs.

func (*VisitUpdate) Save

func (vu *VisitUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*VisitUpdate) SaveX

func (vu *VisitUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*VisitUpdate) SetCreatedAt

func (vu *VisitUpdate) SetCreatedAt(t time.Time) *VisitUpdate

SetCreatedAt sets the "created_at" field.

func (*VisitUpdate) SetDeletedAt

func (vu *VisitUpdate) SetDeletedAt(t time.Time) *VisitUpdate

SetDeletedAt sets the "deleted_at" field.

func (*VisitUpdate) SetIsPaid

func (vu *VisitUpdate) SetIsPaid(b bool) *VisitUpdate

SetIsPaid sets the "is_paid" field.

func (*VisitUpdate) SetNillableCreatedAt

func (vu *VisitUpdate) SetNillableCreatedAt(t *time.Time) *VisitUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*VisitUpdate) SetNillableDeletedAt

func (vu *VisitUpdate) SetNillableDeletedAt(t *time.Time) *VisitUpdate

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*VisitUpdate) SetNillableIsPaid

func (vu *VisitUpdate) SetNillableIsPaid(b *bool) *VisitUpdate

SetNillableIsPaid sets the "is_paid" field if the given value is not nil.

func (*VisitUpdate) SetNillablePaymentType

func (vu *VisitUpdate) SetNillablePaymentType(s *string) *VisitUpdate

SetNillablePaymentType sets the "payment_type" field if the given value is not nil.

func (*VisitUpdate) SetNillableReceptionID

func (vu *VisitUpdate) SetNillableReceptionID(id *int) *VisitUpdate

SetNillableReceptionID sets the "reception" edge to the Reception entity by ID if the given value is not nil.

func (*VisitUpdate) SetNillableUpdatedAt

func (vu *VisitUpdate) SetNillableUpdatedAt(t *time.Time) *VisitUpdate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*VisitUpdate) SetNillableVisitPrice

func (vu *VisitUpdate) SetNillableVisitPrice(s *string) *VisitUpdate

SetNillableVisitPrice sets the "visit_price" field if the given value is not nil.

func (*VisitUpdate) SetNillableVisitedAt

func (vu *VisitUpdate) SetNillableVisitedAt(t *time.Time) *VisitUpdate

SetNillableVisitedAt sets the "visited_at" field if the given value is not nil.

func (*VisitUpdate) SetPaymentType

func (vu *VisitUpdate) SetPaymentType(s string) *VisitUpdate

SetPaymentType sets the "payment_type" field.

func (*VisitUpdate) SetReception

func (vu *VisitUpdate) SetReception(r *Reception) *VisitUpdate

SetReception sets the "reception" edge to the Reception entity.

func (*VisitUpdate) SetReceptionID

func (vu *VisitUpdate) SetReceptionID(id int) *VisitUpdate

SetReceptionID sets the "reception" edge to the Reception entity by ID.

func (*VisitUpdate) SetUpdatedAt

func (vu *VisitUpdate) SetUpdatedAt(t time.Time) *VisitUpdate

SetUpdatedAt sets the "updated_at" field.

func (*VisitUpdate) SetVisitPrice

func (vu *VisitUpdate) SetVisitPrice(s string) *VisitUpdate

SetVisitPrice sets the "visit_price" field.

func (*VisitUpdate) SetVisitedAt

func (vu *VisitUpdate) SetVisitedAt(t time.Time) *VisitUpdate

SetVisitedAt sets the "visited_at" field.

func (*VisitUpdate) Where

func (vu *VisitUpdate) Where(ps ...predicate.Visit) *VisitUpdate

Where appends a list predicates to the VisitUpdate builder.

type VisitUpdateOne

type VisitUpdateOne struct {
	// contains filtered or unexported fields
}

VisitUpdateOne is the builder for updating a single Visit entity.

func (*VisitUpdateOne) AddAttachment

func (vuo *VisitUpdateOne) AddAttachment(a ...*Attachment) *VisitUpdateOne

AddAttachment adds the "attachment" edges to the Attachment entity.

func (*VisitUpdateOne) AddAttachmentIDs

func (vuo *VisitUpdateOne) AddAttachmentIDs(ids ...int) *VisitUpdateOne

AddAttachmentIDs adds the "attachment" edge to the Attachment entity by IDs.

func (*VisitUpdateOne) ClearAttachment

func (vuo *VisitUpdateOne) ClearAttachment() *VisitUpdateOne

ClearAttachment clears all "attachment" edges to the Attachment entity.

func (*VisitUpdateOne) ClearDeletedAt

func (vuo *VisitUpdateOne) ClearDeletedAt() *VisitUpdateOne

ClearDeletedAt clears the value of the "deleted_at" field.

func (*VisitUpdateOne) ClearIsPaid

func (vuo *VisitUpdateOne) ClearIsPaid() *VisitUpdateOne

ClearIsPaid clears the value of the "is_paid" field.

func (*VisitUpdateOne) ClearPaymentType

func (vuo *VisitUpdateOne) ClearPaymentType() *VisitUpdateOne

ClearPaymentType clears the value of the "payment_type" field.

func (*VisitUpdateOne) ClearReception

func (vuo *VisitUpdateOne) ClearReception() *VisitUpdateOne

ClearReception clears the "reception" edge to the Reception entity.

func (*VisitUpdateOne) ClearUpdatedAt

func (vuo *VisitUpdateOne) ClearUpdatedAt() *VisitUpdateOne

ClearUpdatedAt clears the value of the "updated_at" field.

func (*VisitUpdateOne) ClearVisitPrice

func (vuo *VisitUpdateOne) ClearVisitPrice() *VisitUpdateOne

ClearVisitPrice clears the value of the "visit_price" field.

func (*VisitUpdateOne) ClearVisitedAt

func (vuo *VisitUpdateOne) ClearVisitedAt() *VisitUpdateOne

ClearVisitedAt clears the value of the "visited_at" field.

func (*VisitUpdateOne) Exec

func (vuo *VisitUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*VisitUpdateOne) ExecX

func (vuo *VisitUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*VisitUpdateOne) Mutation

func (vuo *VisitUpdateOne) Mutation() *VisitMutation

Mutation returns the VisitMutation object of the builder.

func (*VisitUpdateOne) RemoveAttachment

func (vuo *VisitUpdateOne) RemoveAttachment(a ...*Attachment) *VisitUpdateOne

RemoveAttachment removes "attachment" edges to Attachment entities.

func (*VisitUpdateOne) RemoveAttachmentIDs

func (vuo *VisitUpdateOne) RemoveAttachmentIDs(ids ...int) *VisitUpdateOne

RemoveAttachmentIDs removes the "attachment" edge to Attachment entities by IDs.

func (*VisitUpdateOne) Save

func (vuo *VisitUpdateOne) Save(ctx context.Context) (*Visit, error)

Save executes the query and returns the updated Visit entity.

func (*VisitUpdateOne) SaveX

func (vuo *VisitUpdateOne) SaveX(ctx context.Context) *Visit

SaveX is like Save, but panics if an error occurs.

func (*VisitUpdateOne) Select

func (vuo *VisitUpdateOne) Select(field string, fields ...string) *VisitUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*VisitUpdateOne) SetCreatedAt

func (vuo *VisitUpdateOne) SetCreatedAt(t time.Time) *VisitUpdateOne

SetCreatedAt sets the "created_at" field.

func (*VisitUpdateOne) SetDeletedAt

func (vuo *VisitUpdateOne) SetDeletedAt(t time.Time) *VisitUpdateOne

SetDeletedAt sets the "deleted_at" field.

func (*VisitUpdateOne) SetIsPaid

func (vuo *VisitUpdateOne) SetIsPaid(b bool) *VisitUpdateOne

SetIsPaid sets the "is_paid" field.

func (*VisitUpdateOne) SetNillableCreatedAt

func (vuo *VisitUpdateOne) SetNillableCreatedAt(t *time.Time) *VisitUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*VisitUpdateOne) SetNillableDeletedAt

func (vuo *VisitUpdateOne) SetNillableDeletedAt(t *time.Time) *VisitUpdateOne

SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.

func (*VisitUpdateOne) SetNillableIsPaid

func (vuo *VisitUpdateOne) SetNillableIsPaid(b *bool) *VisitUpdateOne

SetNillableIsPaid sets the "is_paid" field if the given value is not nil.

func (*VisitUpdateOne) SetNillablePaymentType

func (vuo *VisitUpdateOne) SetNillablePaymentType(s *string) *VisitUpdateOne

SetNillablePaymentType sets the "payment_type" field if the given value is not nil.

func (*VisitUpdateOne) SetNillableReceptionID

func (vuo *VisitUpdateOne) SetNillableReceptionID(id *int) *VisitUpdateOne

SetNillableReceptionID sets the "reception" edge to the Reception entity by ID if the given value is not nil.

func (*VisitUpdateOne) SetNillableUpdatedAt

func (vuo *VisitUpdateOne) SetNillableUpdatedAt(t *time.Time) *VisitUpdateOne

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*VisitUpdateOne) SetNillableVisitPrice

func (vuo *VisitUpdateOne) SetNillableVisitPrice(s *string) *VisitUpdateOne

SetNillableVisitPrice sets the "visit_price" field if the given value is not nil.

func (*VisitUpdateOne) SetNillableVisitedAt

func (vuo *VisitUpdateOne) SetNillableVisitedAt(t *time.Time) *VisitUpdateOne

SetNillableVisitedAt sets the "visited_at" field if the given value is not nil.

func (*VisitUpdateOne) SetPaymentType

func (vuo *VisitUpdateOne) SetPaymentType(s string) *VisitUpdateOne

SetPaymentType sets the "payment_type" field.

func (*VisitUpdateOne) SetReception

func (vuo *VisitUpdateOne) SetReception(r *Reception) *VisitUpdateOne

SetReception sets the "reception" edge to the Reception entity.

func (*VisitUpdateOne) SetReceptionID

func (vuo *VisitUpdateOne) SetReceptionID(id int) *VisitUpdateOne

SetReceptionID sets the "reception" edge to the Reception entity by ID.

func (*VisitUpdateOne) SetUpdatedAt

func (vuo *VisitUpdateOne) SetUpdatedAt(t time.Time) *VisitUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*VisitUpdateOne) SetVisitPrice

func (vuo *VisitUpdateOne) SetVisitPrice(s string) *VisitUpdateOne

SetVisitPrice sets the "visit_price" field.

func (*VisitUpdateOne) SetVisitedAt

func (vuo *VisitUpdateOne) SetVisitedAt(t time.Time) *VisitUpdateOne

SetVisitedAt sets the "visited_at" field.

func (*VisitUpdateOne) Where

func (vuo *VisitUpdateOne) Where(ps ...predicate.Visit) *VisitUpdateOne

Where appends a list predicates to the VisitUpdate builder.

type Visits

type Visits []*Visit

Visits is a parsable slice of Visit.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL