ent

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: MIT Imports: 34 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.
	TypeBarGroup        = "BarGroup"
	TypeBarRecord       = "BarRecord"
	TypeBarTimeRange    = "BarTimeRange"
	TypeDataSource      = "DataSource"
	TypeDividend        = "Dividend"
	TypeEntity          = "Entity"
	TypeExchange        = "Exchange"
	TypeFinancial       = "Financial"
	TypeInterval        = "Interval"
	TypeMarketHours     = "MarketHours"
	TypeMarketInfo      = "MarketInfo"
	TypeSplit           = "Split"
	TypeTradeCondition  = "TradeCondition"
	TypeTradeCorrection = "TradeCorrection"
	TypeTradeRecord     = "TradeRecord"
	TypeTradeTimeRange  = "TradeTimeRange"
)

Variables

This section is empty.

Functions

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

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 BarGroup

type BarGroup struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// First holds the value of the "first" field.
	First time.Time `json:"first,omitempty"`
	// Last holds the value of the "last" field.
	Last time.Time `json:"last,omitempty"`
	// Count holds the value of the "count" field.
	Count int `json:"count,omitempty"`
	// TimeRangeID holds the value of the "time_range_id" field.
	TimeRangeID int `json:"time_range_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the BarGroupQuery when eager-loading is set.
	Edges BarGroupEdges `json:"edges"`
	// contains filtered or unexported fields
}

BarGroup is the model entity for the BarGroup schema.

func (*BarGroup) QueryRecords

func (bg *BarGroup) QueryRecords() *BarRecordQuery

QueryRecords queries the "records" edge of the BarGroup entity.

func (*BarGroup) QueryTimeRange

func (bg *BarGroup) QueryTimeRange() *BarTimeRangeQuery

QueryTimeRange queries the "time_range" edge of the BarGroup entity.

func (*BarGroup) String

func (bg *BarGroup) String() string

String implements the fmt.Stringer.

func (*BarGroup) Unwrap

func (bg *BarGroup) Unwrap() *BarGroup

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

func (bg *BarGroup) Update() *BarGroupUpdateOne

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

type BarGroupClient

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

BarGroupClient is a client for the BarGroup schema.

func NewBarGroupClient

func NewBarGroupClient(c config) *BarGroupClient

NewBarGroupClient returns a client for the BarGroup from the given config.

func (*BarGroupClient) Create

func (c *BarGroupClient) Create() *BarGroupCreate

Create returns a builder for creating a BarGroup entity.

func (*BarGroupClient) CreateBulk

func (c *BarGroupClient) CreateBulk(builders ...*BarGroupCreate) *BarGroupCreateBulk

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

func (*BarGroupClient) Delete

func (c *BarGroupClient) Delete() *BarGroupDelete

Delete returns a delete builder for BarGroup.

func (*BarGroupClient) DeleteOne

func (c *BarGroupClient) DeleteOne(bg *BarGroup) *BarGroupDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*BarGroupClient) DeleteOneID

func (c *BarGroupClient) DeleteOneID(id int) *BarGroupDeleteOne

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

func (*BarGroupClient) Get

func (c *BarGroupClient) Get(ctx context.Context, id int) (*BarGroup, error)

Get returns a BarGroup entity by its id.

func (*BarGroupClient) GetX

func (c *BarGroupClient) GetX(ctx context.Context, id int) *BarGroup

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

func (*BarGroupClient) Hooks

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

Hooks returns the client hooks.

func (*BarGroupClient) Intercept

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

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

func (*BarGroupClient) Interceptors

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

Interceptors returns the client interceptors.

func (*BarGroupClient) Query

func (c *BarGroupClient) Query() *BarGroupQuery

Query returns a query builder for BarGroup.

func (*BarGroupClient) QueryRecords

func (c *BarGroupClient) QueryRecords(bg *BarGroup) *BarRecordQuery

QueryRecords queries the records edge of a BarGroup.

func (*BarGroupClient) QueryTimeRange

func (c *BarGroupClient) QueryTimeRange(bg *BarGroup) *BarTimeRangeQuery

QueryTimeRange queries the time_range edge of a BarGroup.

func (*BarGroupClient) Update

func (c *BarGroupClient) Update() *BarGroupUpdate

Update returns an update builder for BarGroup.

func (*BarGroupClient) UpdateOne

func (c *BarGroupClient) UpdateOne(bg *BarGroup) *BarGroupUpdateOne

UpdateOne returns an update builder for the given entity.

func (*BarGroupClient) UpdateOneID

func (c *BarGroupClient) UpdateOneID(id int) *BarGroupUpdateOne

UpdateOneID returns an update builder for the given id.

func (*BarGroupClient) Use

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

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

type BarGroupCreate

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

BarGroupCreate is the builder for creating a BarGroup entity.

func (*BarGroupCreate) AddRecordIDs

func (bgc *BarGroupCreate) AddRecordIDs(ids ...int) *BarGroupCreate

AddRecordIDs adds the "records" edge to the BarRecord entity by IDs.

func (*BarGroupCreate) AddRecords

func (bgc *BarGroupCreate) AddRecords(b ...*BarRecord) *BarGroupCreate

AddRecords adds the "records" edges to the BarRecord entity.

func (*BarGroupCreate) Exec

func (bgc *BarGroupCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*BarGroupCreate) ExecX

func (bgc *BarGroupCreate) ExecX(ctx context.Context)

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

func (*BarGroupCreate) Mutation

func (bgc *BarGroupCreate) Mutation() *BarGroupMutation

Mutation returns the BarGroupMutation object of the builder.

func (*BarGroupCreate) Save

func (bgc *BarGroupCreate) Save(ctx context.Context) (*BarGroup, error)

Save creates the BarGroup in the database.

func (*BarGroupCreate) SaveX

func (bgc *BarGroupCreate) SaveX(ctx context.Context) *BarGroup

SaveX calls Save and panics if Save returns an error.

func (*BarGroupCreate) SetCount

func (bgc *BarGroupCreate) SetCount(i int) *BarGroupCreate

SetCount sets the "count" field.

func (*BarGroupCreate) SetFirst

func (bgc *BarGroupCreate) SetFirst(t time.Time) *BarGroupCreate

SetFirst sets the "first" field.

func (*BarGroupCreate) SetLast

func (bgc *BarGroupCreate) SetLast(t time.Time) *BarGroupCreate

SetLast sets the "last" field.

func (*BarGroupCreate) SetTimeRange

func (bgc *BarGroupCreate) SetTimeRange(b *BarTimeRange) *BarGroupCreate

SetTimeRange sets the "time_range" edge to the BarTimeRange entity.

func (*BarGroupCreate) SetTimeRangeID

func (bgc *BarGroupCreate) SetTimeRangeID(i int) *BarGroupCreate

SetTimeRangeID sets the "time_range_id" field.

type BarGroupCreateBulk

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

BarGroupCreateBulk is the builder for creating many BarGroup entities in bulk.

func (*BarGroupCreateBulk) Exec

func (bgcb *BarGroupCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*BarGroupCreateBulk) ExecX

func (bgcb *BarGroupCreateBulk) ExecX(ctx context.Context)

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

func (*BarGroupCreateBulk) Save

func (bgcb *BarGroupCreateBulk) Save(ctx context.Context) ([]*BarGroup, error)

Save creates the BarGroup entities in the database.

func (*BarGroupCreateBulk) SaveX

func (bgcb *BarGroupCreateBulk) SaveX(ctx context.Context) []*BarGroup

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

type BarGroupDelete

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

BarGroupDelete is the builder for deleting a BarGroup entity.

func (*BarGroupDelete) Exec

func (bgd *BarGroupDelete) Exec(ctx context.Context) (int, error)

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

func (*BarGroupDelete) ExecX

func (bgd *BarGroupDelete) ExecX(ctx context.Context) int

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

func (*BarGroupDelete) Where

func (bgd *BarGroupDelete) Where(ps ...predicate.BarGroup) *BarGroupDelete

Where appends a list predicates to the BarGroupDelete builder.

type BarGroupDeleteOne

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

BarGroupDeleteOne is the builder for deleting a single BarGroup entity.

func (*BarGroupDeleteOne) Exec

func (bgdo *BarGroupDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*BarGroupDeleteOne) ExecX

func (bgdo *BarGroupDeleteOne) ExecX(ctx context.Context)

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

type BarGroupEdges

type BarGroupEdges struct {
	// TimeRange holds the value of the time_range edge.
	TimeRange *BarTimeRange `json:"time_range,omitempty"`
	// Records holds the value of the records edge.
	Records []*BarRecord `json:"records,omitempty"`
	// contains filtered or unexported fields
}

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

func (BarGroupEdges) RecordsOrErr

func (e BarGroupEdges) RecordsOrErr() ([]*BarRecord, error)

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

func (BarGroupEdges) TimeRangeOrErr

func (e BarGroupEdges) TimeRangeOrErr() (*BarTimeRange, error)

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

type BarGroupGroupBy

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

BarGroupGroupBy is the group-by builder for BarGroup entities.

func (*BarGroupGroupBy) Aggregate

func (bggb *BarGroupGroupBy) Aggregate(fns ...AggregateFunc) *BarGroupGroupBy

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

func (*BarGroupGroupBy) Bool

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

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

func (*BarGroupGroupBy) BoolX

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

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

func (*BarGroupGroupBy) Bools

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

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

func (*BarGroupGroupBy) BoolsX

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

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

func (*BarGroupGroupBy) Float64

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

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

func (*BarGroupGroupBy) Float64X

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

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

func (*BarGroupGroupBy) Float64s

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

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

func (*BarGroupGroupBy) Float64sX

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

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

func (*BarGroupGroupBy) Int

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

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

func (*BarGroupGroupBy) IntX

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

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

func (*BarGroupGroupBy) Ints

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

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

func (*BarGroupGroupBy) IntsX

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

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

func (*BarGroupGroupBy) Scan

func (bggb *BarGroupGroupBy) Scan(ctx context.Context, v any) error

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

func (*BarGroupGroupBy) ScanX

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

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

func (*BarGroupGroupBy) String

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

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

func (*BarGroupGroupBy) StringX

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

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

func (*BarGroupGroupBy) Strings

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

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

func (*BarGroupGroupBy) StringsX

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

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

type BarGroupMutation

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

BarGroupMutation represents an operation that mutates the BarGroup nodes in the graph.

func (*BarGroupMutation) AddCount

func (m *BarGroupMutation) AddCount(i int)

AddCount adds i to the "count" field.

func (*BarGroupMutation) AddField

func (m *BarGroupMutation) 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 (*BarGroupMutation) AddRecordIDs

func (m *BarGroupMutation) AddRecordIDs(ids ...int)

AddRecordIDs adds the "records" edge to the BarRecord entity by ids.

func (*BarGroupMutation) AddedCount

func (m *BarGroupMutation) AddedCount() (r int, exists bool)

AddedCount returns the value that was added to the "count" field in this mutation.

func (*BarGroupMutation) AddedEdges

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

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

func (*BarGroupMutation) AddedField

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

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

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

func (*BarGroupMutation) AddedIDs

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

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

func (*BarGroupMutation) ClearEdge

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

func (m *BarGroupMutation) 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 (*BarGroupMutation) ClearRecords

func (m *BarGroupMutation) ClearRecords()

ClearRecords clears the "records" edge to the BarRecord entity.

func (*BarGroupMutation) ClearTimeRange

func (m *BarGroupMutation) ClearTimeRange()

ClearTimeRange clears the "time_range" edge to the BarTimeRange entity.

func (*BarGroupMutation) ClearedEdges

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

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

func (*BarGroupMutation) ClearedFields

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

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

func (BarGroupMutation) Client

func (m BarGroupMutation) 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 (*BarGroupMutation) Count

func (m *BarGroupMutation) Count() (r int, exists bool)

Count returns the value of the "count" field in the mutation.

func (*BarGroupMutation) EdgeCleared

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

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

func (*BarGroupMutation) Field

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

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

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

func (*BarGroupMutation) Fields

func (m *BarGroupMutation) 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 (*BarGroupMutation) First

func (m *BarGroupMutation) First() (r time.Time, exists bool)

First returns the value of the "first" field in the mutation.

func (*BarGroupMutation) ID

func (m *BarGroupMutation) 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 (*BarGroupMutation) IDs

func (m *BarGroupMutation) 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 (*BarGroupMutation) Last

func (m *BarGroupMutation) Last() (r time.Time, exists bool)

Last returns the value of the "last" field in the mutation.

func (*BarGroupMutation) OldCount

func (m *BarGroupMutation) OldCount(ctx context.Context) (v int, err error)

OldCount returns the old "count" field's value of the BarGroup entity. If the BarGroup 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 (*BarGroupMutation) OldField

func (m *BarGroupMutation) 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 (*BarGroupMutation) OldFirst

func (m *BarGroupMutation) OldFirst(ctx context.Context) (v time.Time, err error)

OldFirst returns the old "first" field's value of the BarGroup entity. If the BarGroup 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 (*BarGroupMutation) OldLast

func (m *BarGroupMutation) OldLast(ctx context.Context) (v time.Time, err error)

OldLast returns the old "last" field's value of the BarGroup entity. If the BarGroup 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 (*BarGroupMutation) OldTimeRangeID

func (m *BarGroupMutation) OldTimeRangeID(ctx context.Context) (v int, err error)

OldTimeRangeID returns the old "time_range_id" field's value of the BarGroup entity. If the BarGroup 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 (*BarGroupMutation) Op

func (m *BarGroupMutation) Op() Op

Op returns the operation name.

func (*BarGroupMutation) RecordsCleared

func (m *BarGroupMutation) RecordsCleared() bool

RecordsCleared reports if the "records" edge to the BarRecord entity was cleared.

func (*BarGroupMutation) RecordsIDs

func (m *BarGroupMutation) RecordsIDs() (ids []int)

RecordsIDs returns the "records" edge IDs in the mutation.

func (*BarGroupMutation) RemoveRecordIDs

func (m *BarGroupMutation) RemoveRecordIDs(ids ...int)

RemoveRecordIDs removes the "records" edge to the BarRecord entity by IDs.

func (*BarGroupMutation) RemovedEdges

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

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

func (*BarGroupMutation) RemovedIDs

func (m *BarGroupMutation) 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 (*BarGroupMutation) RemovedRecordsIDs

func (m *BarGroupMutation) RemovedRecordsIDs() (ids []int)

RemovedRecords returns the removed IDs of the "records" edge to the BarRecord entity.

func (*BarGroupMutation) ResetCount

func (m *BarGroupMutation) ResetCount()

ResetCount resets all changes to the "count" field.

func (*BarGroupMutation) ResetEdge

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

func (m *BarGroupMutation) 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 (*BarGroupMutation) ResetFirst

func (m *BarGroupMutation) ResetFirst()

ResetFirst resets all changes to the "first" field.

func (*BarGroupMutation) ResetLast

func (m *BarGroupMutation) ResetLast()

ResetLast resets all changes to the "last" field.

func (*BarGroupMutation) ResetRecords

func (m *BarGroupMutation) ResetRecords()

ResetRecords resets all changes to the "records" edge.

func (*BarGroupMutation) ResetTimeRange

func (m *BarGroupMutation) ResetTimeRange()

ResetTimeRange resets all changes to the "time_range" edge.

func (*BarGroupMutation) ResetTimeRangeID

func (m *BarGroupMutation) ResetTimeRangeID()

ResetTimeRangeID resets all changes to the "time_range_id" field.

func (*BarGroupMutation) SetCount

func (m *BarGroupMutation) SetCount(i int)

SetCount sets the "count" field.

func (*BarGroupMutation) SetField

func (m *BarGroupMutation) 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 (*BarGroupMutation) SetFirst

func (m *BarGroupMutation) SetFirst(t time.Time)

SetFirst sets the "first" field.

func (*BarGroupMutation) SetLast

func (m *BarGroupMutation) SetLast(t time.Time)

SetLast sets the "last" field.

func (*BarGroupMutation) SetOp

func (m *BarGroupMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*BarGroupMutation) SetTimeRangeID

func (m *BarGroupMutation) SetTimeRangeID(i int)

SetTimeRangeID sets the "time_range_id" field.

func (*BarGroupMutation) TimeRangeCleared

func (m *BarGroupMutation) TimeRangeCleared() bool

TimeRangeCleared reports if the "time_range" edge to the BarTimeRange entity was cleared.

func (*BarGroupMutation) TimeRangeID

func (m *BarGroupMutation) TimeRangeID() (r int, exists bool)

TimeRangeID returns the value of the "time_range_id" field in the mutation.

func (*BarGroupMutation) TimeRangeIDs

func (m *BarGroupMutation) TimeRangeIDs() (ids []int)

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

func (BarGroupMutation) Tx

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

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

func (*BarGroupMutation) Type

func (m *BarGroupMutation) Type() string

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

func (*BarGroupMutation) Where

func (m *BarGroupMutation) Where(ps ...predicate.BarGroup)

Where appends a list predicates to the BarGroupMutation builder.

func (*BarGroupMutation) WhereP

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

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

type BarGroupQuery

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

BarGroupQuery is the builder for querying BarGroup entities.

func (*BarGroupQuery) Aggregate

func (bgq *BarGroupQuery) Aggregate(fns ...AggregateFunc) *BarGroupSelect

Aggregate returns a BarGroupSelect configured with the given aggregations.

func (*BarGroupQuery) All

func (bgq *BarGroupQuery) All(ctx context.Context) ([]*BarGroup, error)

All executes the query and returns a list of BarGroups.

func (*BarGroupQuery) AllX

func (bgq *BarGroupQuery) AllX(ctx context.Context) []*BarGroup

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

func (*BarGroupQuery) Clone

func (bgq *BarGroupQuery) Clone() *BarGroupQuery

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

func (*BarGroupQuery) Count

func (bgq *BarGroupQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*BarGroupQuery) CountX

func (bgq *BarGroupQuery) CountX(ctx context.Context) int

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

func (*BarGroupQuery) Exist

func (bgq *BarGroupQuery) Exist(ctx context.Context) (bool, error)

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

func (*BarGroupQuery) ExistX

func (bgq *BarGroupQuery) ExistX(ctx context.Context) bool

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

func (*BarGroupQuery) First

func (bgq *BarGroupQuery) First(ctx context.Context) (*BarGroup, error)

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

func (*BarGroupQuery) FirstID

func (bgq *BarGroupQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*BarGroupQuery) FirstIDX

func (bgq *BarGroupQuery) FirstIDX(ctx context.Context) int

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

func (*BarGroupQuery) FirstX

func (bgq *BarGroupQuery) FirstX(ctx context.Context) *BarGroup

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

func (*BarGroupQuery) GroupBy

func (bgq *BarGroupQuery) GroupBy(field string, fields ...string) *BarGroupGroupBy

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

client.BarGroup.Query().
	GroupBy(bargroup.FieldFirst).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*BarGroupQuery) IDs

func (bgq *BarGroupQuery) IDs(ctx context.Context) ([]int, error)

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

func (*BarGroupQuery) IDsX

func (bgq *BarGroupQuery) IDsX(ctx context.Context) []int

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

func (*BarGroupQuery) Limit

func (bgq *BarGroupQuery) Limit(limit int) *BarGroupQuery

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

func (*BarGroupQuery) Offset

func (bgq *BarGroupQuery) Offset(offset int) *BarGroupQuery

Offset to start from.

func (*BarGroupQuery) Only

func (bgq *BarGroupQuery) Only(ctx context.Context) (*BarGroup, error)

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

func (*BarGroupQuery) OnlyID

func (bgq *BarGroupQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*BarGroupQuery) OnlyIDX

func (bgq *BarGroupQuery) OnlyIDX(ctx context.Context) int

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

func (*BarGroupQuery) OnlyX

func (bgq *BarGroupQuery) OnlyX(ctx context.Context) *BarGroup

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

func (*BarGroupQuery) Order

func (bgq *BarGroupQuery) Order(o ...OrderFunc) *BarGroupQuery

Order specifies how the records should be ordered.

func (*BarGroupQuery) QueryRecords

func (bgq *BarGroupQuery) QueryRecords() *BarRecordQuery

QueryRecords chains the current query on the "records" edge.

func (*BarGroupQuery) QueryTimeRange

func (bgq *BarGroupQuery) QueryTimeRange() *BarTimeRangeQuery

QueryTimeRange chains the current query on the "time_range" edge.

func (*BarGroupQuery) Select

func (bgq *BarGroupQuery) Select(fields ...string) *BarGroupSelect

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

client.BarGroup.Query().
	Select(bargroup.FieldFirst).
	Scan(ctx, &v)

func (*BarGroupQuery) Unique

func (bgq *BarGroupQuery) Unique(unique bool) *BarGroupQuery

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

func (bgq *BarGroupQuery) Where(ps ...predicate.BarGroup) *BarGroupQuery

Where adds a new predicate for the BarGroupQuery builder.

func (*BarGroupQuery) WithRecords

func (bgq *BarGroupQuery) WithRecords(opts ...func(*BarRecordQuery)) *BarGroupQuery

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

func (*BarGroupQuery) WithTimeRange

func (bgq *BarGroupQuery) WithTimeRange(opts ...func(*BarTimeRangeQuery)) *BarGroupQuery

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

type BarGroupSelect

type BarGroupSelect struct {
	*BarGroupQuery
	// contains filtered or unexported fields
}

BarGroupSelect is the builder for selecting fields of BarGroup entities.

func (*BarGroupSelect) Aggregate

func (bgs *BarGroupSelect) Aggregate(fns ...AggregateFunc) *BarGroupSelect

Aggregate adds the given aggregation functions to the selector query.

func (*BarGroupSelect) Bool

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

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

func (*BarGroupSelect) BoolX

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

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

func (*BarGroupSelect) Bools

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

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

func (*BarGroupSelect) BoolsX

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

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

func (*BarGroupSelect) Float64

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

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

func (*BarGroupSelect) Float64X

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

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

func (*BarGroupSelect) Float64s

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

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

func (*BarGroupSelect) Float64sX

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

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

func (*BarGroupSelect) Int

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

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

func (*BarGroupSelect) IntX

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

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

func (*BarGroupSelect) Ints

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

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

func (*BarGroupSelect) IntsX

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

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

func (*BarGroupSelect) Scan

func (bgs *BarGroupSelect) Scan(ctx context.Context, v any) error

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

func (*BarGroupSelect) ScanX

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

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

func (*BarGroupSelect) String

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

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

func (*BarGroupSelect) StringX

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

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

func (*BarGroupSelect) Strings

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

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

func (*BarGroupSelect) StringsX

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

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

type BarGroupUpdate

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

BarGroupUpdate is the builder for updating BarGroup entities.

func (*BarGroupUpdate) AddCount

func (bgu *BarGroupUpdate) AddCount(i int) *BarGroupUpdate

AddCount adds i to the "count" field.

func (*BarGroupUpdate) AddRecordIDs

func (bgu *BarGroupUpdate) AddRecordIDs(ids ...int) *BarGroupUpdate

AddRecordIDs adds the "records" edge to the BarRecord entity by IDs.

func (*BarGroupUpdate) AddRecords

func (bgu *BarGroupUpdate) AddRecords(b ...*BarRecord) *BarGroupUpdate

AddRecords adds the "records" edges to the BarRecord entity.

func (*BarGroupUpdate) ClearRecords

func (bgu *BarGroupUpdate) ClearRecords() *BarGroupUpdate

ClearRecords clears all "records" edges to the BarRecord entity.

func (*BarGroupUpdate) ClearTimeRange

func (bgu *BarGroupUpdate) ClearTimeRange() *BarGroupUpdate

ClearTimeRange clears the "time_range" edge to the BarTimeRange entity.

func (*BarGroupUpdate) Exec

func (bgu *BarGroupUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*BarGroupUpdate) ExecX

func (bgu *BarGroupUpdate) ExecX(ctx context.Context)

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

func (*BarGroupUpdate) Mutation

func (bgu *BarGroupUpdate) Mutation() *BarGroupMutation

Mutation returns the BarGroupMutation object of the builder.

func (*BarGroupUpdate) RemoveRecordIDs

func (bgu *BarGroupUpdate) RemoveRecordIDs(ids ...int) *BarGroupUpdate

RemoveRecordIDs removes the "records" edge to BarRecord entities by IDs.

func (*BarGroupUpdate) RemoveRecords

func (bgu *BarGroupUpdate) RemoveRecords(b ...*BarRecord) *BarGroupUpdate

RemoveRecords removes "records" edges to BarRecord entities.

func (*BarGroupUpdate) Save

func (bgu *BarGroupUpdate) Save(ctx context.Context) (int, error)

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

func (*BarGroupUpdate) SaveX

func (bgu *BarGroupUpdate) SaveX(ctx context.Context) int

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

func (*BarGroupUpdate) SetCount

func (bgu *BarGroupUpdate) SetCount(i int) *BarGroupUpdate

SetCount sets the "count" field.

func (*BarGroupUpdate) SetFirst

func (bgu *BarGroupUpdate) SetFirst(t time.Time) *BarGroupUpdate

SetFirst sets the "first" field.

func (*BarGroupUpdate) SetLast

func (bgu *BarGroupUpdate) SetLast(t time.Time) *BarGroupUpdate

SetLast sets the "last" field.

func (*BarGroupUpdate) SetTimeRange

func (bgu *BarGroupUpdate) SetTimeRange(b *BarTimeRange) *BarGroupUpdate

SetTimeRange sets the "time_range" edge to the BarTimeRange entity.

func (*BarGroupUpdate) SetTimeRangeID

func (bgu *BarGroupUpdate) SetTimeRangeID(i int) *BarGroupUpdate

SetTimeRangeID sets the "time_range_id" field.

func (*BarGroupUpdate) Where

func (bgu *BarGroupUpdate) Where(ps ...predicate.BarGroup) *BarGroupUpdate

Where appends a list predicates to the BarGroupUpdate builder.

type BarGroupUpdateOne

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

BarGroupUpdateOne is the builder for updating a single BarGroup entity.

func (*BarGroupUpdateOne) AddCount

func (bguo *BarGroupUpdateOne) AddCount(i int) *BarGroupUpdateOne

AddCount adds i to the "count" field.

func (*BarGroupUpdateOne) AddRecordIDs

func (bguo *BarGroupUpdateOne) AddRecordIDs(ids ...int) *BarGroupUpdateOne

AddRecordIDs adds the "records" edge to the BarRecord entity by IDs.

func (*BarGroupUpdateOne) AddRecords

func (bguo *BarGroupUpdateOne) AddRecords(b ...*BarRecord) *BarGroupUpdateOne

AddRecords adds the "records" edges to the BarRecord entity.

func (*BarGroupUpdateOne) ClearRecords

func (bguo *BarGroupUpdateOne) ClearRecords() *BarGroupUpdateOne

ClearRecords clears all "records" edges to the BarRecord entity.

func (*BarGroupUpdateOne) ClearTimeRange

func (bguo *BarGroupUpdateOne) ClearTimeRange() *BarGroupUpdateOne

ClearTimeRange clears the "time_range" edge to the BarTimeRange entity.

func (*BarGroupUpdateOne) Exec

func (bguo *BarGroupUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*BarGroupUpdateOne) ExecX

func (bguo *BarGroupUpdateOne) ExecX(ctx context.Context)

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

func (*BarGroupUpdateOne) Mutation

func (bguo *BarGroupUpdateOne) Mutation() *BarGroupMutation

Mutation returns the BarGroupMutation object of the builder.

func (*BarGroupUpdateOne) RemoveRecordIDs

func (bguo *BarGroupUpdateOne) RemoveRecordIDs(ids ...int) *BarGroupUpdateOne

RemoveRecordIDs removes the "records" edge to BarRecord entities by IDs.

func (*BarGroupUpdateOne) RemoveRecords

func (bguo *BarGroupUpdateOne) RemoveRecords(b ...*BarRecord) *BarGroupUpdateOne

RemoveRecords removes "records" edges to BarRecord entities.

func (*BarGroupUpdateOne) Save

func (bguo *BarGroupUpdateOne) Save(ctx context.Context) (*BarGroup, error)

Save executes the query and returns the updated BarGroup entity.

func (*BarGroupUpdateOne) SaveX

func (bguo *BarGroupUpdateOne) SaveX(ctx context.Context) *BarGroup

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

func (*BarGroupUpdateOne) Select

func (bguo *BarGroupUpdateOne) Select(field string, fields ...string) *BarGroupUpdateOne

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

func (*BarGroupUpdateOne) SetCount

func (bguo *BarGroupUpdateOne) SetCount(i int) *BarGroupUpdateOne

SetCount sets the "count" field.

func (*BarGroupUpdateOne) SetFirst

func (bguo *BarGroupUpdateOne) SetFirst(t time.Time) *BarGroupUpdateOne

SetFirst sets the "first" field.

func (*BarGroupUpdateOne) SetLast

func (bguo *BarGroupUpdateOne) SetLast(t time.Time) *BarGroupUpdateOne

SetLast sets the "last" field.

func (*BarGroupUpdateOne) SetTimeRange

func (bguo *BarGroupUpdateOne) SetTimeRange(b *BarTimeRange) *BarGroupUpdateOne

SetTimeRange sets the "time_range" edge to the BarTimeRange entity.

func (*BarGroupUpdateOne) SetTimeRangeID

func (bguo *BarGroupUpdateOne) SetTimeRangeID(i int) *BarGroupUpdateOne

SetTimeRangeID sets the "time_range_id" field.

type BarGroups

type BarGroups []*BarGroup

BarGroups is a parsable slice of BarGroup.

type BarRecord

type BarRecord struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Close holds the value of the "close" field.
	Close float64 `json:"close,omitempty"`
	// High holds the value of the "high" field.
	High float64 `json:"high,omitempty"`
	// Low holds the value of the "low" field.
	Low float64 `json:"low,omitempty"`
	// Open holds the value of the "open" field.
	Open float64 `json:"open,omitempty"`
	// Timestamp holds the value of the "timestamp" field.
	Timestamp time.Time `json:"timestamp,omitempty"`
	// Volume holds the value of the "volume" field.
	Volume float64 `json:"volume,omitempty"`
	// the number of trades during this bar
	Transactions int32 `json:"transactions,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the BarRecordQuery when eager-loading is set.
	Edges BarRecordEdges `json:"edges"`
	// contains filtered or unexported fields
}

BarRecord is the model entity for the BarRecord schema.

func (*BarRecord) QueryGroup

func (br *BarRecord) QueryGroup() *BarGroupQuery

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

func (*BarRecord) String

func (br *BarRecord) String() string

String implements the fmt.Stringer.

func (*BarRecord) Unwrap

func (br *BarRecord) Unwrap() *BarRecord

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

func (br *BarRecord) Update() *BarRecordUpdateOne

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

type BarRecordClient

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

BarRecordClient is a client for the BarRecord schema.

func NewBarRecordClient

func NewBarRecordClient(c config) *BarRecordClient

NewBarRecordClient returns a client for the BarRecord from the given config.

func (*BarRecordClient) Create

func (c *BarRecordClient) Create() *BarRecordCreate

Create returns a builder for creating a BarRecord entity.

func (*BarRecordClient) CreateBulk

func (c *BarRecordClient) CreateBulk(builders ...*BarRecordCreate) *BarRecordCreateBulk

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

func (*BarRecordClient) Delete

func (c *BarRecordClient) Delete() *BarRecordDelete

Delete returns a delete builder for BarRecord.

func (*BarRecordClient) DeleteOne

func (c *BarRecordClient) DeleteOne(br *BarRecord) *BarRecordDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*BarRecordClient) DeleteOneID

func (c *BarRecordClient) DeleteOneID(id int) *BarRecordDeleteOne

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

func (*BarRecordClient) Get

func (c *BarRecordClient) Get(ctx context.Context, id int) (*BarRecord, error)

Get returns a BarRecord entity by its id.

func (*BarRecordClient) GetX

func (c *BarRecordClient) GetX(ctx context.Context, id int) *BarRecord

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

func (*BarRecordClient) Hooks

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

Hooks returns the client hooks.

func (*BarRecordClient) Intercept

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

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

func (*BarRecordClient) Interceptors

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

Interceptors returns the client interceptors.

func (*BarRecordClient) Query

func (c *BarRecordClient) Query() *BarRecordQuery

Query returns a query builder for BarRecord.

func (*BarRecordClient) QueryGroup

func (c *BarRecordClient) QueryGroup(br *BarRecord) *BarGroupQuery

QueryGroup queries the group edge of a BarRecord.

func (*BarRecordClient) Update

func (c *BarRecordClient) Update() *BarRecordUpdate

Update returns an update builder for BarRecord.

func (*BarRecordClient) UpdateOne

func (c *BarRecordClient) UpdateOne(br *BarRecord) *BarRecordUpdateOne

UpdateOne returns an update builder for the given entity.

func (*BarRecordClient) UpdateOneID

func (c *BarRecordClient) UpdateOneID(id int) *BarRecordUpdateOne

UpdateOneID returns an update builder for the given id.

func (*BarRecordClient) Use

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

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

type BarRecordCreate

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

BarRecordCreate is the builder for creating a BarRecord entity.

func (*BarRecordCreate) Exec

func (brc *BarRecordCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*BarRecordCreate) ExecX

func (brc *BarRecordCreate) ExecX(ctx context.Context)

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

func (*BarRecordCreate) Mutation

func (brc *BarRecordCreate) Mutation() *BarRecordMutation

Mutation returns the BarRecordMutation object of the builder.

func (*BarRecordCreate) Save

func (brc *BarRecordCreate) Save(ctx context.Context) (*BarRecord, error)

Save creates the BarRecord in the database.

func (*BarRecordCreate) SaveX

func (brc *BarRecordCreate) SaveX(ctx context.Context) *BarRecord

SaveX calls Save and panics if Save returns an error.

func (*BarRecordCreate) SetClose

func (brc *BarRecordCreate) SetClose(f float64) *BarRecordCreate

SetClose sets the "close" field.

func (*BarRecordCreate) SetGroup

func (brc *BarRecordCreate) SetGroup(b *BarGroup) *BarRecordCreate

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

func (*BarRecordCreate) SetGroupID

func (brc *BarRecordCreate) SetGroupID(id int) *BarRecordCreate

SetGroupID sets the "group" edge to the BarGroup entity by ID.

func (*BarRecordCreate) SetHigh

func (brc *BarRecordCreate) SetHigh(f float64) *BarRecordCreate

SetHigh sets the "high" field.

func (*BarRecordCreate) SetLow

func (brc *BarRecordCreate) SetLow(f float64) *BarRecordCreate

SetLow sets the "low" field.

func (*BarRecordCreate) SetNillableGroupID

func (brc *BarRecordCreate) SetNillableGroupID(id *int) *BarRecordCreate

SetNillableGroupID sets the "group" edge to the BarGroup entity by ID if the given value is not nil.

func (*BarRecordCreate) SetOpen

func (brc *BarRecordCreate) SetOpen(f float64) *BarRecordCreate

SetOpen sets the "open" field.

func (*BarRecordCreate) SetTimestamp

func (brc *BarRecordCreate) SetTimestamp(t time.Time) *BarRecordCreate

SetTimestamp sets the "timestamp" field.

func (*BarRecordCreate) SetTransactions

func (brc *BarRecordCreate) SetTransactions(i int32) *BarRecordCreate

SetTransactions sets the "transactions" field.

func (*BarRecordCreate) SetVolume

func (brc *BarRecordCreate) SetVolume(f float64) *BarRecordCreate

SetVolume sets the "volume" field.

type BarRecordCreateBulk

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

BarRecordCreateBulk is the builder for creating many BarRecord entities in bulk.

func (*BarRecordCreateBulk) Exec

func (brcb *BarRecordCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*BarRecordCreateBulk) ExecX

func (brcb *BarRecordCreateBulk) ExecX(ctx context.Context)

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

func (*BarRecordCreateBulk) Save

func (brcb *BarRecordCreateBulk) Save(ctx context.Context) ([]*BarRecord, error)

Save creates the BarRecord entities in the database.

func (*BarRecordCreateBulk) SaveX

func (brcb *BarRecordCreateBulk) SaveX(ctx context.Context) []*BarRecord

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

type BarRecordDelete

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

BarRecordDelete is the builder for deleting a BarRecord entity.

func (*BarRecordDelete) Exec

func (brd *BarRecordDelete) Exec(ctx context.Context) (int, error)

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

func (*BarRecordDelete) ExecX

func (brd *BarRecordDelete) ExecX(ctx context.Context) int

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

func (*BarRecordDelete) Where

Where appends a list predicates to the BarRecordDelete builder.

type BarRecordDeleteOne

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

BarRecordDeleteOne is the builder for deleting a single BarRecord entity.

func (*BarRecordDeleteOne) Exec

func (brdo *BarRecordDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*BarRecordDeleteOne) ExecX

func (brdo *BarRecordDeleteOne) ExecX(ctx context.Context)

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

type BarRecordEdges

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

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

func (BarRecordEdges) GroupOrErr

func (e BarRecordEdges) GroupOrErr() (*BarGroup, error)

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

type BarRecordGroupBy

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

BarRecordGroupBy is the group-by builder for BarRecord entities.

func (*BarRecordGroupBy) Aggregate

func (brgb *BarRecordGroupBy) Aggregate(fns ...AggregateFunc) *BarRecordGroupBy

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

func (*BarRecordGroupBy) Bool

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

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

func (*BarRecordGroupBy) BoolX

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

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

func (*BarRecordGroupBy) Bools

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

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

func (*BarRecordGroupBy) BoolsX

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

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

func (*BarRecordGroupBy) Float64

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

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

func (*BarRecordGroupBy) Float64X

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

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

func (*BarRecordGroupBy) Float64s

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

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

func (*BarRecordGroupBy) Float64sX

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

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

func (*BarRecordGroupBy) Int

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

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

func (*BarRecordGroupBy) IntX

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

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

func (*BarRecordGroupBy) Ints

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

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

func (*BarRecordGroupBy) IntsX

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

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

func (*BarRecordGroupBy) Scan

func (brgb *BarRecordGroupBy) Scan(ctx context.Context, v any) error

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

func (*BarRecordGroupBy) ScanX

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

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

func (*BarRecordGroupBy) String

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

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

func (*BarRecordGroupBy) StringX

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

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

func (*BarRecordGroupBy) Strings

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

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

func (*BarRecordGroupBy) StringsX

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

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

type BarRecordMutation

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

BarRecordMutation represents an operation that mutates the BarRecord nodes in the graph.

func (*BarRecordMutation) AddClose

func (m *BarRecordMutation) AddClose(f float64)

AddClose adds f to the "close" field.

func (*BarRecordMutation) AddField

func (m *BarRecordMutation) 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 (*BarRecordMutation) AddHigh

func (m *BarRecordMutation) AddHigh(f float64)

AddHigh adds f to the "high" field.

func (*BarRecordMutation) AddLow

func (m *BarRecordMutation) AddLow(f float64)

AddLow adds f to the "low" field.

func (*BarRecordMutation) AddOpen

func (m *BarRecordMutation) AddOpen(f float64)

AddOpen adds f to the "open" field.

func (*BarRecordMutation) AddTransactions

func (m *BarRecordMutation) AddTransactions(i int32)

AddTransactions adds i to the "transactions" field.

func (*BarRecordMutation) AddVolume

func (m *BarRecordMutation) AddVolume(f float64)

AddVolume adds f to the "volume" field.

func (*BarRecordMutation) AddedClose

func (m *BarRecordMutation) AddedClose() (r float64, exists bool)

AddedClose returns the value that was added to the "close" field in this mutation.

func (*BarRecordMutation) AddedEdges

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

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

func (*BarRecordMutation) AddedField

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

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

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

func (*BarRecordMutation) AddedHigh

func (m *BarRecordMutation) AddedHigh() (r float64, exists bool)

AddedHigh returns the value that was added to the "high" field in this mutation.

func (*BarRecordMutation) AddedIDs

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

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

func (*BarRecordMutation) AddedLow

func (m *BarRecordMutation) AddedLow() (r float64, exists bool)

AddedLow returns the value that was added to the "low" field in this mutation.

func (*BarRecordMutation) AddedOpen

func (m *BarRecordMutation) AddedOpen() (r float64, exists bool)

AddedOpen returns the value that was added to the "open" field in this mutation.

func (*BarRecordMutation) AddedTransactions

func (m *BarRecordMutation) AddedTransactions() (r int32, exists bool)

AddedTransactions returns the value that was added to the "transactions" field in this mutation.

func (*BarRecordMutation) AddedVolume

func (m *BarRecordMutation) AddedVolume() (r float64, exists bool)

AddedVolume returns the value that was added to the "volume" field in this mutation.

func (*BarRecordMutation) ClearEdge

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

func (m *BarRecordMutation) 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 (*BarRecordMutation) ClearGroup

func (m *BarRecordMutation) ClearGroup()

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

func (*BarRecordMutation) ClearedEdges

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

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

func (*BarRecordMutation) ClearedFields

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

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

func (BarRecordMutation) Client

func (m BarRecordMutation) 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 (*BarRecordMutation) Close

func (m *BarRecordMutation) Close() (r float64, exists bool)

Close returns the value of the "close" field in the mutation.

func (*BarRecordMutation) EdgeCleared

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

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

func (*BarRecordMutation) Field

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

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

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

func (*BarRecordMutation) Fields

func (m *BarRecordMutation) 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 (*BarRecordMutation) GroupCleared

func (m *BarRecordMutation) GroupCleared() bool

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

func (*BarRecordMutation) GroupID

func (m *BarRecordMutation) GroupID() (id int, exists bool)

GroupID returns the "group" edge ID in the mutation.

func (*BarRecordMutation) GroupIDs

func (m *BarRecordMutation) GroupIDs() (ids []int)

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

func (*BarRecordMutation) High

func (m *BarRecordMutation) High() (r float64, exists bool)

High returns the value of the "high" field in the mutation.

func (*BarRecordMutation) ID

func (m *BarRecordMutation) 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 (*BarRecordMutation) IDs

func (m *BarRecordMutation) 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 (*BarRecordMutation) Low

func (m *BarRecordMutation) Low() (r float64, exists bool)

Low returns the value of the "low" field in the mutation.

func (*BarRecordMutation) OldClose

func (m *BarRecordMutation) OldClose(ctx context.Context) (v float64, err error)

OldClose returns the old "close" field's value of the BarRecord entity. If the BarRecord 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 (*BarRecordMutation) OldField

func (m *BarRecordMutation) 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 (*BarRecordMutation) OldHigh

func (m *BarRecordMutation) OldHigh(ctx context.Context) (v float64, err error)

OldHigh returns the old "high" field's value of the BarRecord entity. If the BarRecord 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 (*BarRecordMutation) OldLow

func (m *BarRecordMutation) OldLow(ctx context.Context) (v float64, err error)

OldLow returns the old "low" field's value of the BarRecord entity. If the BarRecord 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 (*BarRecordMutation) OldOpen

func (m *BarRecordMutation) OldOpen(ctx context.Context) (v float64, err error)

OldOpen returns the old "open" field's value of the BarRecord entity. If the BarRecord 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 (*BarRecordMutation) OldTimestamp

func (m *BarRecordMutation) OldTimestamp(ctx context.Context) (v time.Time, err error)

OldTimestamp returns the old "timestamp" field's value of the BarRecord entity. If the BarRecord 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 (*BarRecordMutation) OldTransactions

func (m *BarRecordMutation) OldTransactions(ctx context.Context) (v int32, err error)

OldTransactions returns the old "transactions" field's value of the BarRecord entity. If the BarRecord 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 (*BarRecordMutation) OldVolume

func (m *BarRecordMutation) OldVolume(ctx context.Context) (v float64, err error)

OldVolume returns the old "volume" field's value of the BarRecord entity. If the BarRecord 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 (*BarRecordMutation) Op

func (m *BarRecordMutation) Op() Op

Op returns the operation name.

func (*BarRecordMutation) Open

func (m *BarRecordMutation) Open() (r float64, exists bool)

Open returns the value of the "open" field in the mutation.

func (*BarRecordMutation) RemovedEdges

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

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

func (*BarRecordMutation) RemovedIDs

func (m *BarRecordMutation) 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 (*BarRecordMutation) ResetClose

func (m *BarRecordMutation) ResetClose()

ResetClose resets all changes to the "close" field.

func (*BarRecordMutation) ResetEdge

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

func (m *BarRecordMutation) 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 (*BarRecordMutation) ResetGroup

func (m *BarRecordMutation) ResetGroup()

ResetGroup resets all changes to the "group" edge.

func (*BarRecordMutation) ResetHigh

func (m *BarRecordMutation) ResetHigh()

ResetHigh resets all changes to the "high" field.

func (*BarRecordMutation) ResetLow

func (m *BarRecordMutation) ResetLow()

ResetLow resets all changes to the "low" field.

func (*BarRecordMutation) ResetOpen

func (m *BarRecordMutation) ResetOpen()

ResetOpen resets all changes to the "open" field.

func (*BarRecordMutation) ResetTimestamp

func (m *BarRecordMutation) ResetTimestamp()

ResetTimestamp resets all changes to the "timestamp" field.

func (*BarRecordMutation) ResetTransactions

func (m *BarRecordMutation) ResetTransactions()

ResetTransactions resets all changes to the "transactions" field.

func (*BarRecordMutation) ResetVolume

func (m *BarRecordMutation) ResetVolume()

ResetVolume resets all changes to the "volume" field.

func (*BarRecordMutation) SetClose

func (m *BarRecordMutation) SetClose(f float64)

SetClose sets the "close" field.

func (*BarRecordMutation) SetField

func (m *BarRecordMutation) 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 (*BarRecordMutation) SetGroupID

func (m *BarRecordMutation) SetGroupID(id int)

SetGroupID sets the "group" edge to the BarGroup entity by id.

func (*BarRecordMutation) SetHigh

func (m *BarRecordMutation) SetHigh(f float64)

SetHigh sets the "high" field.

func (*BarRecordMutation) SetLow

func (m *BarRecordMutation) SetLow(f float64)

SetLow sets the "low" field.

func (*BarRecordMutation) SetOp

func (m *BarRecordMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*BarRecordMutation) SetOpen

func (m *BarRecordMutation) SetOpen(f float64)

SetOpen sets the "open" field.

func (*BarRecordMutation) SetTimestamp

func (m *BarRecordMutation) SetTimestamp(t time.Time)

SetTimestamp sets the "timestamp" field.

func (*BarRecordMutation) SetTransactions

func (m *BarRecordMutation) SetTransactions(i int32)

SetTransactions sets the "transactions" field.

func (*BarRecordMutation) SetVolume

func (m *BarRecordMutation) SetVolume(f float64)

SetVolume sets the "volume" field.

func (*BarRecordMutation) Timestamp

func (m *BarRecordMutation) Timestamp() (r time.Time, exists bool)

Timestamp returns the value of the "timestamp" field in the mutation.

func (*BarRecordMutation) Transactions

func (m *BarRecordMutation) Transactions() (r int32, exists bool)

Transactions returns the value of the "transactions" field in the mutation.

func (BarRecordMutation) Tx

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

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

func (*BarRecordMutation) Type

func (m *BarRecordMutation) Type() string

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

func (*BarRecordMutation) Volume

func (m *BarRecordMutation) Volume() (r float64, exists bool)

Volume returns the value of the "volume" field in the mutation.

func (*BarRecordMutation) Where

func (m *BarRecordMutation) Where(ps ...predicate.BarRecord)

Where appends a list predicates to the BarRecordMutation builder.

func (*BarRecordMutation) WhereP

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

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

type BarRecordQuery

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

BarRecordQuery is the builder for querying BarRecord entities.

func (*BarRecordQuery) Aggregate

func (brq *BarRecordQuery) Aggregate(fns ...AggregateFunc) *BarRecordSelect

Aggregate returns a BarRecordSelect configured with the given aggregations.

func (*BarRecordQuery) All

func (brq *BarRecordQuery) All(ctx context.Context) ([]*BarRecord, error)

All executes the query and returns a list of BarRecords.

func (*BarRecordQuery) AllX

func (brq *BarRecordQuery) AllX(ctx context.Context) []*BarRecord

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

func (*BarRecordQuery) Clone

func (brq *BarRecordQuery) Clone() *BarRecordQuery

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

func (*BarRecordQuery) Count

func (brq *BarRecordQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*BarRecordQuery) CountX

func (brq *BarRecordQuery) CountX(ctx context.Context) int

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

func (*BarRecordQuery) Exist

func (brq *BarRecordQuery) Exist(ctx context.Context) (bool, error)

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

func (*BarRecordQuery) ExistX

func (brq *BarRecordQuery) ExistX(ctx context.Context) bool

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

func (*BarRecordQuery) First

func (brq *BarRecordQuery) First(ctx context.Context) (*BarRecord, error)

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

func (*BarRecordQuery) FirstID

func (brq *BarRecordQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*BarRecordQuery) FirstIDX

func (brq *BarRecordQuery) FirstIDX(ctx context.Context) int

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

func (*BarRecordQuery) FirstX

func (brq *BarRecordQuery) FirstX(ctx context.Context) *BarRecord

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

func (*BarRecordQuery) GroupBy

func (brq *BarRecordQuery) GroupBy(field string, fields ...string) *BarRecordGroupBy

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 {
	Close float64 `json:"close,omitempty"`
	Count int `json:"count,omitempty"`
}

client.BarRecord.Query().
	GroupBy(barrecord.FieldClose).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*BarRecordQuery) IDs

func (brq *BarRecordQuery) IDs(ctx context.Context) ([]int, error)

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

func (*BarRecordQuery) IDsX

func (brq *BarRecordQuery) IDsX(ctx context.Context) []int

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

func (*BarRecordQuery) Limit

func (brq *BarRecordQuery) Limit(limit int) *BarRecordQuery

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

func (*BarRecordQuery) Offset

func (brq *BarRecordQuery) Offset(offset int) *BarRecordQuery

Offset to start from.

func (*BarRecordQuery) Only

func (brq *BarRecordQuery) Only(ctx context.Context) (*BarRecord, error)

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

func (*BarRecordQuery) OnlyID

func (brq *BarRecordQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*BarRecordQuery) OnlyIDX

func (brq *BarRecordQuery) OnlyIDX(ctx context.Context) int

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

func (*BarRecordQuery) OnlyX

func (brq *BarRecordQuery) OnlyX(ctx context.Context) *BarRecord

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

func (*BarRecordQuery) Order

func (brq *BarRecordQuery) Order(o ...OrderFunc) *BarRecordQuery

Order specifies how the records should be ordered.

func (*BarRecordQuery) QueryGroup

func (brq *BarRecordQuery) QueryGroup() *BarGroupQuery

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

func (*BarRecordQuery) Select

func (brq *BarRecordQuery) Select(fields ...string) *BarRecordSelect

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 {
	Close float64 `json:"close,omitempty"`
}

client.BarRecord.Query().
	Select(barrecord.FieldClose).
	Scan(ctx, &v)

func (*BarRecordQuery) Unique

func (brq *BarRecordQuery) Unique(unique bool) *BarRecordQuery

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

func (brq *BarRecordQuery) Where(ps ...predicate.BarRecord) *BarRecordQuery

Where adds a new predicate for the BarRecordQuery builder.

func (*BarRecordQuery) WithGroup

func (brq *BarRecordQuery) WithGroup(opts ...func(*BarGroupQuery)) *BarRecordQuery

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

type BarRecordSelect

type BarRecordSelect struct {
	*BarRecordQuery
	// contains filtered or unexported fields
}

BarRecordSelect is the builder for selecting fields of BarRecord entities.

func (*BarRecordSelect) Aggregate

func (brs *BarRecordSelect) Aggregate(fns ...AggregateFunc) *BarRecordSelect

Aggregate adds the given aggregation functions to the selector query.

func (*BarRecordSelect) Bool

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

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

func (*BarRecordSelect) BoolX

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

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

func (*BarRecordSelect) Bools

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

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

func (*BarRecordSelect) BoolsX

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

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

func (*BarRecordSelect) Float64

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

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

func (*BarRecordSelect) Float64X

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

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

func (*BarRecordSelect) Float64s

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

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

func (*BarRecordSelect) Float64sX

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

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

func (*BarRecordSelect) Int

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

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

func (*BarRecordSelect) IntX

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

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

func (*BarRecordSelect) Ints

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

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

func (*BarRecordSelect) IntsX

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

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

func (*BarRecordSelect) Scan

func (brs *BarRecordSelect) Scan(ctx context.Context, v any) error

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

func (*BarRecordSelect) ScanX

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

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

func (*BarRecordSelect) String

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

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

func (*BarRecordSelect) StringX

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

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

func (*BarRecordSelect) Strings

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

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

func (*BarRecordSelect) StringsX

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

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

type BarRecordUpdate

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

BarRecordUpdate is the builder for updating BarRecord entities.

func (*BarRecordUpdate) AddClose

func (bru *BarRecordUpdate) AddClose(f float64) *BarRecordUpdate

AddClose adds f to the "close" field.

func (*BarRecordUpdate) AddHigh

func (bru *BarRecordUpdate) AddHigh(f float64) *BarRecordUpdate

AddHigh adds f to the "high" field.

func (*BarRecordUpdate) AddLow

func (bru *BarRecordUpdate) AddLow(f float64) *BarRecordUpdate

AddLow adds f to the "low" field.

func (*BarRecordUpdate) AddOpen

func (bru *BarRecordUpdate) AddOpen(f float64) *BarRecordUpdate

AddOpen adds f to the "open" field.

func (*BarRecordUpdate) AddTransactions

func (bru *BarRecordUpdate) AddTransactions(i int32) *BarRecordUpdate

AddTransactions adds i to the "transactions" field.

func (*BarRecordUpdate) AddVolume

func (bru *BarRecordUpdate) AddVolume(f float64) *BarRecordUpdate

AddVolume adds f to the "volume" field.

func (*BarRecordUpdate) ClearGroup

func (bru *BarRecordUpdate) ClearGroup() *BarRecordUpdate

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

func (*BarRecordUpdate) Exec

func (bru *BarRecordUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*BarRecordUpdate) ExecX

func (bru *BarRecordUpdate) ExecX(ctx context.Context)

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

func (*BarRecordUpdate) Mutation

func (bru *BarRecordUpdate) Mutation() *BarRecordMutation

Mutation returns the BarRecordMutation object of the builder.

func (*BarRecordUpdate) Save

func (bru *BarRecordUpdate) Save(ctx context.Context) (int, error)

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

func (*BarRecordUpdate) SaveX

func (bru *BarRecordUpdate) SaveX(ctx context.Context) int

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

func (*BarRecordUpdate) SetClose

func (bru *BarRecordUpdate) SetClose(f float64) *BarRecordUpdate

SetClose sets the "close" field.

func (*BarRecordUpdate) SetGroup

func (bru *BarRecordUpdate) SetGroup(b *BarGroup) *BarRecordUpdate

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

func (*BarRecordUpdate) SetGroupID

func (bru *BarRecordUpdate) SetGroupID(id int) *BarRecordUpdate

SetGroupID sets the "group" edge to the BarGroup entity by ID.

func (*BarRecordUpdate) SetHigh

func (bru *BarRecordUpdate) SetHigh(f float64) *BarRecordUpdate

SetHigh sets the "high" field.

func (*BarRecordUpdate) SetLow

func (bru *BarRecordUpdate) SetLow(f float64) *BarRecordUpdate

SetLow sets the "low" field.

func (*BarRecordUpdate) SetNillableGroupID

func (bru *BarRecordUpdate) SetNillableGroupID(id *int) *BarRecordUpdate

SetNillableGroupID sets the "group" edge to the BarGroup entity by ID if the given value is not nil.

func (*BarRecordUpdate) SetOpen

func (bru *BarRecordUpdate) SetOpen(f float64) *BarRecordUpdate

SetOpen sets the "open" field.

func (*BarRecordUpdate) SetTimestamp

func (bru *BarRecordUpdate) SetTimestamp(t time.Time) *BarRecordUpdate

SetTimestamp sets the "timestamp" field.

func (*BarRecordUpdate) SetTransactions

func (bru *BarRecordUpdate) SetTransactions(i int32) *BarRecordUpdate

SetTransactions sets the "transactions" field.

func (*BarRecordUpdate) SetVolume

func (bru *BarRecordUpdate) SetVolume(f float64) *BarRecordUpdate

SetVolume sets the "volume" field.

func (*BarRecordUpdate) Where

Where appends a list predicates to the BarRecordUpdate builder.

type BarRecordUpdateOne

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

BarRecordUpdateOne is the builder for updating a single BarRecord entity.

func (*BarRecordUpdateOne) AddClose

func (bruo *BarRecordUpdateOne) AddClose(f float64) *BarRecordUpdateOne

AddClose adds f to the "close" field.

func (*BarRecordUpdateOne) AddHigh

func (bruo *BarRecordUpdateOne) AddHigh(f float64) *BarRecordUpdateOne

AddHigh adds f to the "high" field.

func (*BarRecordUpdateOne) AddLow

AddLow adds f to the "low" field.

func (*BarRecordUpdateOne) AddOpen

func (bruo *BarRecordUpdateOne) AddOpen(f float64) *BarRecordUpdateOne

AddOpen adds f to the "open" field.

func (*BarRecordUpdateOne) AddTransactions

func (bruo *BarRecordUpdateOne) AddTransactions(i int32) *BarRecordUpdateOne

AddTransactions adds i to the "transactions" field.

func (*BarRecordUpdateOne) AddVolume

func (bruo *BarRecordUpdateOne) AddVolume(f float64) *BarRecordUpdateOne

AddVolume adds f to the "volume" field.

func (*BarRecordUpdateOne) ClearGroup

func (bruo *BarRecordUpdateOne) ClearGroup() *BarRecordUpdateOne

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

func (*BarRecordUpdateOne) Exec

func (bruo *BarRecordUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*BarRecordUpdateOne) ExecX

func (bruo *BarRecordUpdateOne) ExecX(ctx context.Context)

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

func (*BarRecordUpdateOne) Mutation

func (bruo *BarRecordUpdateOne) Mutation() *BarRecordMutation

Mutation returns the BarRecordMutation object of the builder.

func (*BarRecordUpdateOne) Save

func (bruo *BarRecordUpdateOne) Save(ctx context.Context) (*BarRecord, error)

Save executes the query and returns the updated BarRecord entity.

func (*BarRecordUpdateOne) SaveX

func (bruo *BarRecordUpdateOne) SaveX(ctx context.Context) *BarRecord

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

func (*BarRecordUpdateOne) Select

func (bruo *BarRecordUpdateOne) Select(field string, fields ...string) *BarRecordUpdateOne

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

func (*BarRecordUpdateOne) SetClose

func (bruo *BarRecordUpdateOne) SetClose(f float64) *BarRecordUpdateOne

SetClose sets the "close" field.

func (*BarRecordUpdateOne) SetGroup

func (bruo *BarRecordUpdateOne) SetGroup(b *BarGroup) *BarRecordUpdateOne

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

func (*BarRecordUpdateOne) SetGroupID

func (bruo *BarRecordUpdateOne) SetGroupID(id int) *BarRecordUpdateOne

SetGroupID sets the "group" edge to the BarGroup entity by ID.

func (*BarRecordUpdateOne) SetHigh

func (bruo *BarRecordUpdateOne) SetHigh(f float64) *BarRecordUpdateOne

SetHigh sets the "high" field.

func (*BarRecordUpdateOne) SetLow

SetLow sets the "low" field.

func (*BarRecordUpdateOne) SetNillableGroupID

func (bruo *BarRecordUpdateOne) SetNillableGroupID(id *int) *BarRecordUpdateOne

SetNillableGroupID sets the "group" edge to the BarGroup entity by ID if the given value is not nil.

func (*BarRecordUpdateOne) SetOpen

func (bruo *BarRecordUpdateOne) SetOpen(f float64) *BarRecordUpdateOne

SetOpen sets the "open" field.

func (*BarRecordUpdateOne) SetTimestamp

func (bruo *BarRecordUpdateOne) SetTimestamp(t time.Time) *BarRecordUpdateOne

SetTimestamp sets the "timestamp" field.

func (*BarRecordUpdateOne) SetTransactions

func (bruo *BarRecordUpdateOne) SetTransactions(i int32) *BarRecordUpdateOne

SetTransactions sets the "transactions" field.

func (*BarRecordUpdateOne) SetVolume

func (bruo *BarRecordUpdateOne) SetVolume(f float64) *BarRecordUpdateOne

SetVolume sets the "volume" field.

type BarRecords

type BarRecords []*BarRecord

BarRecords is a parsable slice of BarRecord.

type BarTimeRange

type BarTimeRange struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Start holds the value of the "start" field.
	Start time.Time `json:"start,omitempty"`
	// End holds the value of the "end" field.
	End time.Time `json:"end,omitempty"`
	// The number of BarGroups
	Count int `json:"count,omitempty"`
	// IntervalID holds the value of the "interval_id" field.
	IntervalID int `json:"interval_id,omitempty"`
	// Status holds the value of the "status" field.
	Status bartimerange.Status `json:"status,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the BarTimeRangeQuery when eager-loading is set.
	Edges BarTimeRangeEdges `json:"edges"`
	// contains filtered or unexported fields
}

BarTimeRange is the model entity for the BarTimeRange schema.

func (*BarTimeRange) QueryGroups

func (btr *BarTimeRange) QueryGroups() *BarGroupQuery

QueryGroups queries the "groups" edge of the BarTimeRange entity.

func (*BarTimeRange) QueryInterval

func (btr *BarTimeRange) QueryInterval() *IntervalQuery

QueryInterval queries the "interval" edge of the BarTimeRange entity.

func (*BarTimeRange) String

func (btr *BarTimeRange) String() string

String implements the fmt.Stringer.

func (*BarTimeRange) Unwrap

func (btr *BarTimeRange) Unwrap() *BarTimeRange

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

func (btr *BarTimeRange) Update() *BarTimeRangeUpdateOne

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

type BarTimeRangeClient

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

BarTimeRangeClient is a client for the BarTimeRange schema.

func NewBarTimeRangeClient

func NewBarTimeRangeClient(c config) *BarTimeRangeClient

NewBarTimeRangeClient returns a client for the BarTimeRange from the given config.

func (*BarTimeRangeClient) Create

Create returns a builder for creating a BarTimeRange entity.

func (*BarTimeRangeClient) CreateBulk

func (c *BarTimeRangeClient) CreateBulk(builders ...*BarTimeRangeCreate) *BarTimeRangeCreateBulk

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

func (*BarTimeRangeClient) Delete

Delete returns a delete builder for BarTimeRange.

func (*BarTimeRangeClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*BarTimeRangeClient) DeleteOneID

func (c *BarTimeRangeClient) DeleteOneID(id int) *BarTimeRangeDeleteOne

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

func (*BarTimeRangeClient) Get

Get returns a BarTimeRange entity by its id.

func (*BarTimeRangeClient) GetX

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

func (*BarTimeRangeClient) Hooks

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

Hooks returns the client hooks.

func (*BarTimeRangeClient) Intercept

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

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

func (*BarTimeRangeClient) Interceptors

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

Interceptors returns the client interceptors.

func (*BarTimeRangeClient) Query

Query returns a query builder for BarTimeRange.

func (*BarTimeRangeClient) QueryGroups

func (c *BarTimeRangeClient) QueryGroups(btr *BarTimeRange) *BarGroupQuery

QueryGroups queries the groups edge of a BarTimeRange.

func (*BarTimeRangeClient) QueryInterval

func (c *BarTimeRangeClient) QueryInterval(btr *BarTimeRange) *IntervalQuery

QueryInterval queries the interval edge of a BarTimeRange.

func (*BarTimeRangeClient) Update

Update returns an update builder for BarTimeRange.

func (*BarTimeRangeClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*BarTimeRangeClient) UpdateOneID

func (c *BarTimeRangeClient) UpdateOneID(id int) *BarTimeRangeUpdateOne

UpdateOneID returns an update builder for the given id.

func (*BarTimeRangeClient) Use

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

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

type BarTimeRangeCreate

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

BarTimeRangeCreate is the builder for creating a BarTimeRange entity.

func (*BarTimeRangeCreate) AddGroupIDs

func (btrc *BarTimeRangeCreate) AddGroupIDs(ids ...int) *BarTimeRangeCreate

AddGroupIDs adds the "groups" edge to the BarGroup entity by IDs.

func (*BarTimeRangeCreate) AddGroups

func (btrc *BarTimeRangeCreate) AddGroups(b ...*BarGroup) *BarTimeRangeCreate

AddGroups adds the "groups" edges to the BarGroup entity.

func (*BarTimeRangeCreate) Exec

func (btrc *BarTimeRangeCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*BarTimeRangeCreate) ExecX

func (btrc *BarTimeRangeCreate) ExecX(ctx context.Context)

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

func (*BarTimeRangeCreate) Mutation

func (btrc *BarTimeRangeCreate) Mutation() *BarTimeRangeMutation

Mutation returns the BarTimeRangeMutation object of the builder.

func (*BarTimeRangeCreate) Save

func (btrc *BarTimeRangeCreate) Save(ctx context.Context) (*BarTimeRange, error)

Save creates the BarTimeRange in the database.

func (*BarTimeRangeCreate) SaveX

func (btrc *BarTimeRangeCreate) SaveX(ctx context.Context) *BarTimeRange

SaveX calls Save and panics if Save returns an error.

func (*BarTimeRangeCreate) SetCount

func (btrc *BarTimeRangeCreate) SetCount(i int) *BarTimeRangeCreate

SetCount sets the "count" field.

func (*BarTimeRangeCreate) SetEnd

SetEnd sets the "end" field.

func (*BarTimeRangeCreate) SetInterval

func (btrc *BarTimeRangeCreate) SetInterval(i *Interval) *BarTimeRangeCreate

SetInterval sets the "interval" edge to the Interval entity.

func (*BarTimeRangeCreate) SetIntervalID

func (btrc *BarTimeRangeCreate) SetIntervalID(i int) *BarTimeRangeCreate

SetIntervalID sets the "interval_id" field.

func (*BarTimeRangeCreate) SetNillableCount

func (btrc *BarTimeRangeCreate) SetNillableCount(i *int) *BarTimeRangeCreate

SetNillableCount sets the "count" field if the given value is not nil.

func (*BarTimeRangeCreate) SetNillableStatus

func (btrc *BarTimeRangeCreate) SetNillableStatus(b *bartimerange.Status) *BarTimeRangeCreate

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

func (*BarTimeRangeCreate) SetNillableUpdateTime

func (btrc *BarTimeRangeCreate) SetNillableUpdateTime(t *time.Time) *BarTimeRangeCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*BarTimeRangeCreate) SetStart

func (btrc *BarTimeRangeCreate) SetStart(t time.Time) *BarTimeRangeCreate

SetStart sets the "start" field.

func (*BarTimeRangeCreate) SetStatus

SetStatus sets the "status" field.

func (*BarTimeRangeCreate) SetUpdateTime

func (btrc *BarTimeRangeCreate) SetUpdateTime(t time.Time) *BarTimeRangeCreate

SetUpdateTime sets the "update_time" field.

type BarTimeRangeCreateBulk

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

BarTimeRangeCreateBulk is the builder for creating many BarTimeRange entities in bulk.

func (*BarTimeRangeCreateBulk) Exec

func (btrcb *BarTimeRangeCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*BarTimeRangeCreateBulk) ExecX

func (btrcb *BarTimeRangeCreateBulk) ExecX(ctx context.Context)

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

func (*BarTimeRangeCreateBulk) Save

func (btrcb *BarTimeRangeCreateBulk) Save(ctx context.Context) ([]*BarTimeRange, error)

Save creates the BarTimeRange entities in the database.

func (*BarTimeRangeCreateBulk) SaveX

func (btrcb *BarTimeRangeCreateBulk) SaveX(ctx context.Context) []*BarTimeRange

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

type BarTimeRangeDelete

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

BarTimeRangeDelete is the builder for deleting a BarTimeRange entity.

func (*BarTimeRangeDelete) Exec

func (btrd *BarTimeRangeDelete) Exec(ctx context.Context) (int, error)

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

func (*BarTimeRangeDelete) ExecX

func (btrd *BarTimeRangeDelete) ExecX(ctx context.Context) int

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

func (*BarTimeRangeDelete) Where

Where appends a list predicates to the BarTimeRangeDelete builder.

type BarTimeRangeDeleteOne

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

BarTimeRangeDeleteOne is the builder for deleting a single BarTimeRange entity.

func (*BarTimeRangeDeleteOne) Exec

func (btrdo *BarTimeRangeDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*BarTimeRangeDeleteOne) ExecX

func (btrdo *BarTimeRangeDeleteOne) ExecX(ctx context.Context)

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

type BarTimeRangeEdges

type BarTimeRangeEdges struct {
	// Interval holds the value of the interval edge.
	Interval *Interval `json:"interval,omitempty"`
	// Groups holds the value of the groups edge.
	Groups []*BarGroup `json:"groups,omitempty"`
	// contains filtered or unexported fields
}

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

func (BarTimeRangeEdges) GroupsOrErr

func (e BarTimeRangeEdges) GroupsOrErr() ([]*BarGroup, error)

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

func (BarTimeRangeEdges) IntervalOrErr

func (e BarTimeRangeEdges) IntervalOrErr() (*Interval, error)

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

type BarTimeRangeGroupBy

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

BarTimeRangeGroupBy is the group-by builder for BarTimeRange entities.

func (*BarTimeRangeGroupBy) Aggregate

func (btrgb *BarTimeRangeGroupBy) Aggregate(fns ...AggregateFunc) *BarTimeRangeGroupBy

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

func (*BarTimeRangeGroupBy) Bool

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

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

func (*BarTimeRangeGroupBy) BoolX

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

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

func (*BarTimeRangeGroupBy) Bools

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

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

func (*BarTimeRangeGroupBy) BoolsX

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

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

func (*BarTimeRangeGroupBy) Float64

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

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

func (*BarTimeRangeGroupBy) Float64X

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

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

func (*BarTimeRangeGroupBy) Float64s

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

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

func (*BarTimeRangeGroupBy) Float64sX

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

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

func (*BarTimeRangeGroupBy) Int

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

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

func (*BarTimeRangeGroupBy) IntX

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

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

func (*BarTimeRangeGroupBy) Ints

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

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

func (*BarTimeRangeGroupBy) IntsX

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

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

func (*BarTimeRangeGroupBy) Scan

func (btrgb *BarTimeRangeGroupBy) Scan(ctx context.Context, v any) error

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

func (*BarTimeRangeGroupBy) ScanX

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

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

func (*BarTimeRangeGroupBy) String

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

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

func (*BarTimeRangeGroupBy) StringX

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

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

func (*BarTimeRangeGroupBy) Strings

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

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

func (*BarTimeRangeGroupBy) StringsX

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

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

type BarTimeRangeMutation

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

BarTimeRangeMutation represents an operation that mutates the BarTimeRange nodes in the graph.

func (*BarTimeRangeMutation) AddCount

func (m *BarTimeRangeMutation) AddCount(i int)

AddCount adds i to the "count" field.

func (*BarTimeRangeMutation) AddField

func (m *BarTimeRangeMutation) 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 (*BarTimeRangeMutation) AddGroupIDs

func (m *BarTimeRangeMutation) AddGroupIDs(ids ...int)

AddGroupIDs adds the "groups" edge to the BarGroup entity by ids.

func (*BarTimeRangeMutation) AddedCount

func (m *BarTimeRangeMutation) AddedCount() (r int, exists bool)

AddedCount returns the value that was added to the "count" field in this mutation.

func (*BarTimeRangeMutation) AddedEdges

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

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

func (*BarTimeRangeMutation) AddedField

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

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

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

func (*BarTimeRangeMutation) AddedIDs

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

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

func (*BarTimeRangeMutation) ClearEdge

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

func (m *BarTimeRangeMutation) 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 (*BarTimeRangeMutation) ClearGroups

func (m *BarTimeRangeMutation) ClearGroups()

ClearGroups clears the "groups" edge to the BarGroup entity.

func (*BarTimeRangeMutation) ClearInterval

func (m *BarTimeRangeMutation) ClearInterval()

ClearInterval clears the "interval" edge to the Interval entity.

func (*BarTimeRangeMutation) ClearedEdges

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

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

func (*BarTimeRangeMutation) ClearedFields

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

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

func (BarTimeRangeMutation) Client

func (m BarTimeRangeMutation) 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 (*BarTimeRangeMutation) Count

func (m *BarTimeRangeMutation) Count() (r int, exists bool)

Count returns the value of the "count" field in the mutation.

func (*BarTimeRangeMutation) EdgeCleared

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

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

func (*BarTimeRangeMutation) End

func (m *BarTimeRangeMutation) End() (r time.Time, exists bool)

End returns the value of the "end" field in the mutation.

func (*BarTimeRangeMutation) Field

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

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

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

func (*BarTimeRangeMutation) Fields

func (m *BarTimeRangeMutation) 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 (*BarTimeRangeMutation) GroupsCleared

func (m *BarTimeRangeMutation) GroupsCleared() bool

GroupsCleared reports if the "groups" edge to the BarGroup entity was cleared.

func (*BarTimeRangeMutation) GroupsIDs

func (m *BarTimeRangeMutation) GroupsIDs() (ids []int)

GroupsIDs returns the "groups" edge IDs in the mutation.

func (*BarTimeRangeMutation) ID

func (m *BarTimeRangeMutation) 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 (*BarTimeRangeMutation) IDs

func (m *BarTimeRangeMutation) 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 (*BarTimeRangeMutation) IntervalCleared

func (m *BarTimeRangeMutation) IntervalCleared() bool

IntervalCleared reports if the "interval" edge to the Interval entity was cleared.

func (*BarTimeRangeMutation) IntervalID

func (m *BarTimeRangeMutation) IntervalID() (r int, exists bool)

IntervalID returns the value of the "interval_id" field in the mutation.

func (*BarTimeRangeMutation) IntervalIDs

func (m *BarTimeRangeMutation) IntervalIDs() (ids []int)

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

func (*BarTimeRangeMutation) OldCount

func (m *BarTimeRangeMutation) OldCount(ctx context.Context) (v int, err error)

OldCount returns the old "count" field's value of the BarTimeRange entity. If the BarTimeRange 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 (*BarTimeRangeMutation) OldEnd

func (m *BarTimeRangeMutation) OldEnd(ctx context.Context) (v time.Time, err error)

OldEnd returns the old "end" field's value of the BarTimeRange entity. If the BarTimeRange 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 (*BarTimeRangeMutation) OldField

func (m *BarTimeRangeMutation) 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 (*BarTimeRangeMutation) OldIntervalID

func (m *BarTimeRangeMutation) OldIntervalID(ctx context.Context) (v int, err error)

OldIntervalID returns the old "interval_id" field's value of the BarTimeRange entity. If the BarTimeRange 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 (*BarTimeRangeMutation) OldStart

func (m *BarTimeRangeMutation) OldStart(ctx context.Context) (v time.Time, err error)

OldStart returns the old "start" field's value of the BarTimeRange entity. If the BarTimeRange 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 (*BarTimeRangeMutation) OldStatus

func (m *BarTimeRangeMutation) OldStatus(ctx context.Context) (v bartimerange.Status, err error)

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

func (m *BarTimeRangeMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the BarTimeRange entity. If the BarTimeRange 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 (*BarTimeRangeMutation) Op

func (m *BarTimeRangeMutation) Op() Op

Op returns the operation name.

func (*BarTimeRangeMutation) RemoveGroupIDs

func (m *BarTimeRangeMutation) RemoveGroupIDs(ids ...int)

RemoveGroupIDs removes the "groups" edge to the BarGroup entity by IDs.

func (*BarTimeRangeMutation) RemovedEdges

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

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

func (*BarTimeRangeMutation) RemovedGroupsIDs

func (m *BarTimeRangeMutation) RemovedGroupsIDs() (ids []int)

RemovedGroups returns the removed IDs of the "groups" edge to the BarGroup entity.

func (*BarTimeRangeMutation) RemovedIDs

func (m *BarTimeRangeMutation) 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 (*BarTimeRangeMutation) ResetCount

func (m *BarTimeRangeMutation) ResetCount()

ResetCount resets all changes to the "count" field.

func (*BarTimeRangeMutation) ResetEdge

func (m *BarTimeRangeMutation) 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 (*BarTimeRangeMutation) ResetEnd

func (m *BarTimeRangeMutation) ResetEnd()

ResetEnd resets all changes to the "end" field.

func (*BarTimeRangeMutation) ResetField

func (m *BarTimeRangeMutation) 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 (*BarTimeRangeMutation) ResetGroups

func (m *BarTimeRangeMutation) ResetGroups()

ResetGroups resets all changes to the "groups" edge.

func (*BarTimeRangeMutation) ResetInterval

func (m *BarTimeRangeMutation) ResetInterval()

ResetInterval resets all changes to the "interval" edge.

func (*BarTimeRangeMutation) ResetIntervalID

func (m *BarTimeRangeMutation) ResetIntervalID()

ResetIntervalID resets all changes to the "interval_id" field.

func (*BarTimeRangeMutation) ResetStart

func (m *BarTimeRangeMutation) ResetStart()

ResetStart resets all changes to the "start" field.

func (*BarTimeRangeMutation) ResetStatus

func (m *BarTimeRangeMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*BarTimeRangeMutation) ResetUpdateTime

func (m *BarTimeRangeMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*BarTimeRangeMutation) SetCount

func (m *BarTimeRangeMutation) SetCount(i int)

SetCount sets the "count" field.

func (*BarTimeRangeMutation) SetEnd

func (m *BarTimeRangeMutation) SetEnd(t time.Time)

SetEnd sets the "end" field.

func (*BarTimeRangeMutation) SetField

func (m *BarTimeRangeMutation) 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 (*BarTimeRangeMutation) SetIntervalID

func (m *BarTimeRangeMutation) SetIntervalID(i int)

SetIntervalID sets the "interval_id" field.

func (*BarTimeRangeMutation) SetOp

func (m *BarTimeRangeMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*BarTimeRangeMutation) SetStart

func (m *BarTimeRangeMutation) SetStart(t time.Time)

SetStart sets the "start" field.

func (*BarTimeRangeMutation) SetStatus

func (m *BarTimeRangeMutation) SetStatus(b bartimerange.Status)

SetStatus sets the "status" field.

func (*BarTimeRangeMutation) SetUpdateTime

func (m *BarTimeRangeMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*BarTimeRangeMutation) Start

func (m *BarTimeRangeMutation) Start() (r time.Time, exists bool)

Start returns the value of the "start" field in the mutation.

func (*BarTimeRangeMutation) Status

func (m *BarTimeRangeMutation) Status() (r bartimerange.Status, exists bool)

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

func (BarTimeRangeMutation) Tx

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

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

func (*BarTimeRangeMutation) Type

func (m *BarTimeRangeMutation) Type() string

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

func (*BarTimeRangeMutation) UpdateTime

func (m *BarTimeRangeMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*BarTimeRangeMutation) Where

Where appends a list predicates to the BarTimeRangeMutation builder.

func (*BarTimeRangeMutation) WhereP

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

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

type BarTimeRangeQuery

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

BarTimeRangeQuery is the builder for querying BarTimeRange entities.

func (*BarTimeRangeQuery) Aggregate

func (btrq *BarTimeRangeQuery) Aggregate(fns ...AggregateFunc) *BarTimeRangeSelect

Aggregate returns a BarTimeRangeSelect configured with the given aggregations.

func (*BarTimeRangeQuery) All

func (btrq *BarTimeRangeQuery) All(ctx context.Context) ([]*BarTimeRange, error)

All executes the query and returns a list of BarTimeRanges.

func (*BarTimeRangeQuery) AllX

func (btrq *BarTimeRangeQuery) AllX(ctx context.Context) []*BarTimeRange

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

func (*BarTimeRangeQuery) Clone

func (btrq *BarTimeRangeQuery) Clone() *BarTimeRangeQuery

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

func (*BarTimeRangeQuery) Count

func (btrq *BarTimeRangeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*BarTimeRangeQuery) CountX

func (btrq *BarTimeRangeQuery) CountX(ctx context.Context) int

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

func (*BarTimeRangeQuery) Exist

func (btrq *BarTimeRangeQuery) Exist(ctx context.Context) (bool, error)

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

func (*BarTimeRangeQuery) ExistX

func (btrq *BarTimeRangeQuery) ExistX(ctx context.Context) bool

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

func (*BarTimeRangeQuery) First

func (btrq *BarTimeRangeQuery) First(ctx context.Context) (*BarTimeRange, error)

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

func (*BarTimeRangeQuery) FirstID

func (btrq *BarTimeRangeQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*BarTimeRangeQuery) FirstIDX

func (btrq *BarTimeRangeQuery) FirstIDX(ctx context.Context) int

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

func (*BarTimeRangeQuery) FirstX

func (btrq *BarTimeRangeQuery) FirstX(ctx context.Context) *BarTimeRange

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

func (*BarTimeRangeQuery) GroupBy

func (btrq *BarTimeRangeQuery) GroupBy(field string, fields ...string) *BarTimeRangeGroupBy

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

client.BarTimeRange.Query().
	GroupBy(bartimerange.FieldStart).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*BarTimeRangeQuery) IDs

func (btrq *BarTimeRangeQuery) IDs(ctx context.Context) ([]int, error)

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

func (*BarTimeRangeQuery) IDsX

func (btrq *BarTimeRangeQuery) IDsX(ctx context.Context) []int

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

func (*BarTimeRangeQuery) Limit

func (btrq *BarTimeRangeQuery) Limit(limit int) *BarTimeRangeQuery

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

func (*BarTimeRangeQuery) Offset

func (btrq *BarTimeRangeQuery) Offset(offset int) *BarTimeRangeQuery

Offset to start from.

func (*BarTimeRangeQuery) Only

func (btrq *BarTimeRangeQuery) Only(ctx context.Context) (*BarTimeRange, error)

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

func (*BarTimeRangeQuery) OnlyID

func (btrq *BarTimeRangeQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*BarTimeRangeQuery) OnlyIDX

func (btrq *BarTimeRangeQuery) OnlyIDX(ctx context.Context) int

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

func (*BarTimeRangeQuery) OnlyX

func (btrq *BarTimeRangeQuery) OnlyX(ctx context.Context) *BarTimeRange

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

func (*BarTimeRangeQuery) Order

func (btrq *BarTimeRangeQuery) Order(o ...OrderFunc) *BarTimeRangeQuery

Order specifies how the records should be ordered.

func (*BarTimeRangeQuery) QueryGroups

func (btrq *BarTimeRangeQuery) QueryGroups() *BarGroupQuery

QueryGroups chains the current query on the "groups" edge.

func (*BarTimeRangeQuery) QueryInterval

func (btrq *BarTimeRangeQuery) QueryInterval() *IntervalQuery

QueryInterval chains the current query on the "interval" edge.

func (*BarTimeRangeQuery) Select

func (btrq *BarTimeRangeQuery) Select(fields ...string) *BarTimeRangeSelect

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

client.BarTimeRange.Query().
	Select(bartimerange.FieldStart).
	Scan(ctx, &v)

func (*BarTimeRangeQuery) Unique

func (btrq *BarTimeRangeQuery) Unique(unique bool) *BarTimeRangeQuery

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

Where adds a new predicate for the BarTimeRangeQuery builder.

func (*BarTimeRangeQuery) WithGroups

func (btrq *BarTimeRangeQuery) WithGroups(opts ...func(*BarGroupQuery)) *BarTimeRangeQuery

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

func (*BarTimeRangeQuery) WithInterval

func (btrq *BarTimeRangeQuery) WithInterval(opts ...func(*IntervalQuery)) *BarTimeRangeQuery

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

type BarTimeRangeSelect

type BarTimeRangeSelect struct {
	*BarTimeRangeQuery
	// contains filtered or unexported fields
}

BarTimeRangeSelect is the builder for selecting fields of BarTimeRange entities.

func (*BarTimeRangeSelect) Aggregate

func (btrs *BarTimeRangeSelect) Aggregate(fns ...AggregateFunc) *BarTimeRangeSelect

Aggregate adds the given aggregation functions to the selector query.

func (*BarTimeRangeSelect) Bool

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

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

func (*BarTimeRangeSelect) BoolX

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

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

func (*BarTimeRangeSelect) Bools

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

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

func (*BarTimeRangeSelect) BoolsX

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

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

func (*BarTimeRangeSelect) Float64

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

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

func (*BarTimeRangeSelect) Float64X

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

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

func (*BarTimeRangeSelect) Float64s

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

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

func (*BarTimeRangeSelect) Float64sX

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

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

func (*BarTimeRangeSelect) Int

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

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

func (*BarTimeRangeSelect) IntX

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

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

func (*BarTimeRangeSelect) Ints

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

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

func (*BarTimeRangeSelect) IntsX

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

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

func (*BarTimeRangeSelect) Scan

func (btrs *BarTimeRangeSelect) Scan(ctx context.Context, v any) error

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

func (*BarTimeRangeSelect) ScanX

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

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

func (*BarTimeRangeSelect) String

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

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

func (*BarTimeRangeSelect) StringX

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

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

func (*BarTimeRangeSelect) Strings

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

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

func (*BarTimeRangeSelect) StringsX

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

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

type BarTimeRangeUpdate

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

BarTimeRangeUpdate is the builder for updating BarTimeRange entities.

func (*BarTimeRangeUpdate) AddCount

func (btru *BarTimeRangeUpdate) AddCount(i int) *BarTimeRangeUpdate

AddCount adds i to the "count" field.

func (*BarTimeRangeUpdate) AddGroupIDs

func (btru *BarTimeRangeUpdate) AddGroupIDs(ids ...int) *BarTimeRangeUpdate

AddGroupIDs adds the "groups" edge to the BarGroup entity by IDs.

func (*BarTimeRangeUpdate) AddGroups

func (btru *BarTimeRangeUpdate) AddGroups(b ...*BarGroup) *BarTimeRangeUpdate

AddGroups adds the "groups" edges to the BarGroup entity.

func (*BarTimeRangeUpdate) ClearGroups

func (btru *BarTimeRangeUpdate) ClearGroups() *BarTimeRangeUpdate

ClearGroups clears all "groups" edges to the BarGroup entity.

func (*BarTimeRangeUpdate) ClearInterval

func (btru *BarTimeRangeUpdate) ClearInterval() *BarTimeRangeUpdate

ClearInterval clears the "interval" edge to the Interval entity.

func (*BarTimeRangeUpdate) Exec

func (btru *BarTimeRangeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*BarTimeRangeUpdate) ExecX

func (btru *BarTimeRangeUpdate) ExecX(ctx context.Context)

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

func (*BarTimeRangeUpdate) Mutation

func (btru *BarTimeRangeUpdate) Mutation() *BarTimeRangeMutation

Mutation returns the BarTimeRangeMutation object of the builder.

func (*BarTimeRangeUpdate) RemoveGroupIDs

func (btru *BarTimeRangeUpdate) RemoveGroupIDs(ids ...int) *BarTimeRangeUpdate

RemoveGroupIDs removes the "groups" edge to BarGroup entities by IDs.

func (*BarTimeRangeUpdate) RemoveGroups

func (btru *BarTimeRangeUpdate) RemoveGroups(b ...*BarGroup) *BarTimeRangeUpdate

RemoveGroups removes "groups" edges to BarGroup entities.

func (*BarTimeRangeUpdate) Save

func (btru *BarTimeRangeUpdate) Save(ctx context.Context) (int, error)

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

func (*BarTimeRangeUpdate) SaveX

func (btru *BarTimeRangeUpdate) SaveX(ctx context.Context) int

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

func (*BarTimeRangeUpdate) SetCount

func (btru *BarTimeRangeUpdate) SetCount(i int) *BarTimeRangeUpdate

SetCount sets the "count" field.

func (*BarTimeRangeUpdate) SetEnd

SetEnd sets the "end" field.

func (*BarTimeRangeUpdate) SetInterval

func (btru *BarTimeRangeUpdate) SetInterval(i *Interval) *BarTimeRangeUpdate

SetInterval sets the "interval" edge to the Interval entity.

func (*BarTimeRangeUpdate) SetIntervalID

func (btru *BarTimeRangeUpdate) SetIntervalID(i int) *BarTimeRangeUpdate

SetIntervalID sets the "interval_id" field.

func (*BarTimeRangeUpdate) SetNillableCount

func (btru *BarTimeRangeUpdate) SetNillableCount(i *int) *BarTimeRangeUpdate

SetNillableCount sets the "count" field if the given value is not nil.

func (*BarTimeRangeUpdate) SetNillableStatus

func (btru *BarTimeRangeUpdate) SetNillableStatus(b *bartimerange.Status) *BarTimeRangeUpdate

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

func (*BarTimeRangeUpdate) SetStart

func (btru *BarTimeRangeUpdate) SetStart(t time.Time) *BarTimeRangeUpdate

SetStart sets the "start" field.

func (*BarTimeRangeUpdate) SetStatus

SetStatus sets the "status" field.

func (*BarTimeRangeUpdate) SetUpdateTime

func (btru *BarTimeRangeUpdate) SetUpdateTime(t time.Time) *BarTimeRangeUpdate

SetUpdateTime sets the "update_time" field.

func (*BarTimeRangeUpdate) Where

Where appends a list predicates to the BarTimeRangeUpdate builder.

type BarTimeRangeUpdateOne

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

BarTimeRangeUpdateOne is the builder for updating a single BarTimeRange entity.

func (*BarTimeRangeUpdateOne) AddCount

func (btruo *BarTimeRangeUpdateOne) AddCount(i int) *BarTimeRangeUpdateOne

AddCount adds i to the "count" field.

func (*BarTimeRangeUpdateOne) AddGroupIDs

func (btruo *BarTimeRangeUpdateOne) AddGroupIDs(ids ...int) *BarTimeRangeUpdateOne

AddGroupIDs adds the "groups" edge to the BarGroup entity by IDs.

func (*BarTimeRangeUpdateOne) AddGroups

func (btruo *BarTimeRangeUpdateOne) AddGroups(b ...*BarGroup) *BarTimeRangeUpdateOne

AddGroups adds the "groups" edges to the BarGroup entity.

func (*BarTimeRangeUpdateOne) ClearGroups

func (btruo *BarTimeRangeUpdateOne) ClearGroups() *BarTimeRangeUpdateOne

ClearGroups clears all "groups" edges to the BarGroup entity.

func (*BarTimeRangeUpdateOne) ClearInterval

func (btruo *BarTimeRangeUpdateOne) ClearInterval() *BarTimeRangeUpdateOne

ClearInterval clears the "interval" edge to the Interval entity.

func (*BarTimeRangeUpdateOne) Exec

func (btruo *BarTimeRangeUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*BarTimeRangeUpdateOne) ExecX

func (btruo *BarTimeRangeUpdateOne) ExecX(ctx context.Context)

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

func (*BarTimeRangeUpdateOne) Mutation

func (btruo *BarTimeRangeUpdateOne) Mutation() *BarTimeRangeMutation

Mutation returns the BarTimeRangeMutation object of the builder.

func (*BarTimeRangeUpdateOne) RemoveGroupIDs

func (btruo *BarTimeRangeUpdateOne) RemoveGroupIDs(ids ...int) *BarTimeRangeUpdateOne

RemoveGroupIDs removes the "groups" edge to BarGroup entities by IDs.

func (*BarTimeRangeUpdateOne) RemoveGroups

func (btruo *BarTimeRangeUpdateOne) RemoveGroups(b ...*BarGroup) *BarTimeRangeUpdateOne

RemoveGroups removes "groups" edges to BarGroup entities.

func (*BarTimeRangeUpdateOne) Save

Save executes the query and returns the updated BarTimeRange entity.

func (*BarTimeRangeUpdateOne) SaveX

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

func (*BarTimeRangeUpdateOne) Select

func (btruo *BarTimeRangeUpdateOne) Select(field string, fields ...string) *BarTimeRangeUpdateOne

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

func (*BarTimeRangeUpdateOne) SetCount

func (btruo *BarTimeRangeUpdateOne) SetCount(i int) *BarTimeRangeUpdateOne

SetCount sets the "count" field.

func (*BarTimeRangeUpdateOne) SetEnd

SetEnd sets the "end" field.

func (*BarTimeRangeUpdateOne) SetInterval

func (btruo *BarTimeRangeUpdateOne) SetInterval(i *Interval) *BarTimeRangeUpdateOne

SetInterval sets the "interval" edge to the Interval entity.

func (*BarTimeRangeUpdateOne) SetIntervalID

func (btruo *BarTimeRangeUpdateOne) SetIntervalID(i int) *BarTimeRangeUpdateOne

SetIntervalID sets the "interval_id" field.

func (*BarTimeRangeUpdateOne) SetNillableCount

func (btruo *BarTimeRangeUpdateOne) SetNillableCount(i *int) *BarTimeRangeUpdateOne

SetNillableCount sets the "count" field if the given value is not nil.

func (*BarTimeRangeUpdateOne) SetNillableStatus

func (btruo *BarTimeRangeUpdateOne) SetNillableStatus(b *bartimerange.Status) *BarTimeRangeUpdateOne

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

func (*BarTimeRangeUpdateOne) SetStart

SetStart sets the "start" field.

func (*BarTimeRangeUpdateOne) SetStatus

SetStatus sets the "status" field.

func (*BarTimeRangeUpdateOne) SetUpdateTime

func (btruo *BarTimeRangeUpdateOne) SetUpdateTime(t time.Time) *BarTimeRangeUpdateOne

SetUpdateTime sets the "update_time" field.

type BarTimeRanges

type BarTimeRanges []*BarTimeRange

BarTimeRanges is a parsable slice of BarTimeRange.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// BarGroup is the client for interacting with the BarGroup builders.
	BarGroup *BarGroupClient
	// BarRecord is the client for interacting with the BarRecord builders.
	BarRecord *BarRecordClient
	// BarTimeRange is the client for interacting with the BarTimeRange builders.
	BarTimeRange *BarTimeRangeClient
	// DataSource is the client for interacting with the DataSource builders.
	DataSource *DataSourceClient
	// Dividend is the client for interacting with the Dividend builders.
	Dividend *DividendClient
	// Entity is the client for interacting with the Entity builders.
	Entity *EntityClient
	// Exchange is the client for interacting with the Exchange builders.
	Exchange *ExchangeClient
	// Financial is the client for interacting with the Financial builders.
	Financial *FinancialClient
	// Interval is the client for interacting with the Interval builders.
	Interval *IntervalClient
	// MarketHours is the client for interacting with the MarketHours builders.
	MarketHours *MarketHoursClient
	// MarketInfo is the client for interacting with the MarketInfo builders.
	MarketInfo *MarketInfoClient
	// Split is the client for interacting with the Split builders.
	Split *SplitClient
	// TradeCondition is the client for interacting with the TradeCondition builders.
	TradeCondition *TradeConditionClient
	// TradeCorrection is the client for interacting with the TradeCorrection builders.
	TradeCorrection *TradeCorrectionClient
	// TradeRecord is the client for interacting with the TradeRecord builders.
	TradeRecord *TradeRecordClient
	// TradeTimeRange is the client for interacting with the TradeTimeRange builders.
	TradeTimeRange *TradeTimeRangeClient
	// 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().
	BarGroup.
	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 DataSource

type DataSource struct {

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

DataSource is the model entity for the DataSource schema.

func (*DataSource) QueryIntervals

func (ds *DataSource) QueryIntervals() *IntervalQuery

QueryIntervals queries the "intervals" edge of the DataSource entity.

func (*DataSource) String

func (ds *DataSource) String() string

String implements the fmt.Stringer.

func (*DataSource) Unwrap

func (ds *DataSource) Unwrap() *DataSource

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

func (ds *DataSource) Update() *DataSourceUpdateOne

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

type DataSourceClient

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

DataSourceClient is a client for the DataSource schema.

func NewDataSourceClient

func NewDataSourceClient(c config) *DataSourceClient

NewDataSourceClient returns a client for the DataSource from the given config.

func (*DataSourceClient) Create

func (c *DataSourceClient) Create() *DataSourceCreate

Create returns a builder for creating a DataSource entity.

func (*DataSourceClient) CreateBulk

func (c *DataSourceClient) CreateBulk(builders ...*DataSourceCreate) *DataSourceCreateBulk

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

func (*DataSourceClient) Delete

func (c *DataSourceClient) Delete() *DataSourceDelete

Delete returns a delete builder for DataSource.

func (*DataSourceClient) DeleteOne

func (c *DataSourceClient) DeleteOne(ds *DataSource) *DataSourceDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*DataSourceClient) DeleteOneID

func (c *DataSourceClient) DeleteOneID(id int) *DataSourceDeleteOne

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

func (*DataSourceClient) Get

func (c *DataSourceClient) Get(ctx context.Context, id int) (*DataSource, error)

Get returns a DataSource entity by its id.

func (*DataSourceClient) GetX

func (c *DataSourceClient) GetX(ctx context.Context, id int) *DataSource

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

func (*DataSourceClient) Hooks

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

Hooks returns the client hooks.

func (*DataSourceClient) Intercept

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

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

func (*DataSourceClient) Interceptors

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

Interceptors returns the client interceptors.

func (*DataSourceClient) Query

func (c *DataSourceClient) Query() *DataSourceQuery

Query returns a query builder for DataSource.

func (*DataSourceClient) QueryIntervals

func (c *DataSourceClient) QueryIntervals(ds *DataSource) *IntervalQuery

QueryIntervals queries the intervals edge of a DataSource.

func (*DataSourceClient) Update

func (c *DataSourceClient) Update() *DataSourceUpdate

Update returns an update builder for DataSource.

func (*DataSourceClient) UpdateOne

func (c *DataSourceClient) UpdateOne(ds *DataSource) *DataSourceUpdateOne

UpdateOne returns an update builder for the given entity.

func (*DataSourceClient) UpdateOneID

func (c *DataSourceClient) UpdateOneID(id int) *DataSourceUpdateOne

UpdateOneID returns an update builder for the given id.

func (*DataSourceClient) Use

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

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

type DataSourceCreate

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

DataSourceCreate is the builder for creating a DataSource entity.

func (*DataSourceCreate) AddIntervalIDs

func (dsc *DataSourceCreate) AddIntervalIDs(ids ...int) *DataSourceCreate

AddIntervalIDs adds the "intervals" edge to the Interval entity by IDs.

func (*DataSourceCreate) AddIntervals

func (dsc *DataSourceCreate) AddIntervals(i ...*Interval) *DataSourceCreate

AddIntervals adds the "intervals" edges to the Interval entity.

func (*DataSourceCreate) Exec

func (dsc *DataSourceCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*DataSourceCreate) ExecX

func (dsc *DataSourceCreate) ExecX(ctx context.Context)

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

func (*DataSourceCreate) Mutation

func (dsc *DataSourceCreate) Mutation() *DataSourceMutation

Mutation returns the DataSourceMutation object of the builder.

func (*DataSourceCreate) Save

func (dsc *DataSourceCreate) Save(ctx context.Context) (*DataSource, error)

Save creates the DataSource in the database.

func (*DataSourceCreate) SaveX

func (dsc *DataSourceCreate) SaveX(ctx context.Context) *DataSource

SaveX calls Save and panics if Save returns an error.

func (*DataSourceCreate) SetAddress

func (dsc *DataSourceCreate) SetAddress(s string) *DataSourceCreate

SetAddress sets the "address" field.

func (*DataSourceCreate) SetName

func (dsc *DataSourceCreate) SetName(s string) *DataSourceCreate

SetName sets the "name" field.

func (*DataSourceCreate) SetNillableAddress

func (dsc *DataSourceCreate) SetNillableAddress(s *string) *DataSourceCreate

SetNillableAddress sets the "address" field if the given value is not nil.

type DataSourceCreateBulk

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

DataSourceCreateBulk is the builder for creating many DataSource entities in bulk.

func (*DataSourceCreateBulk) Exec

func (dscb *DataSourceCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*DataSourceCreateBulk) ExecX

func (dscb *DataSourceCreateBulk) ExecX(ctx context.Context)

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

func (*DataSourceCreateBulk) Save

func (dscb *DataSourceCreateBulk) Save(ctx context.Context) ([]*DataSource, error)

Save creates the DataSource entities in the database.

func (*DataSourceCreateBulk) SaveX

func (dscb *DataSourceCreateBulk) SaveX(ctx context.Context) []*DataSource

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

type DataSourceDelete

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

DataSourceDelete is the builder for deleting a DataSource entity.

func (*DataSourceDelete) Exec

func (dsd *DataSourceDelete) Exec(ctx context.Context) (int, error)

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

func (*DataSourceDelete) ExecX

func (dsd *DataSourceDelete) ExecX(ctx context.Context) int

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

func (*DataSourceDelete) Where

Where appends a list predicates to the DataSourceDelete builder.

type DataSourceDeleteOne

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

DataSourceDeleteOne is the builder for deleting a single DataSource entity.

func (*DataSourceDeleteOne) Exec

func (dsdo *DataSourceDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*DataSourceDeleteOne) ExecX

func (dsdo *DataSourceDeleteOne) ExecX(ctx context.Context)

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

type DataSourceEdges

type DataSourceEdges struct {
	// Intervals holds the value of the intervals edge.
	Intervals []*Interval `json:"intervals,omitempty"`
	// contains filtered or unexported fields
}

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

func (DataSourceEdges) IntervalsOrErr

func (e DataSourceEdges) IntervalsOrErr() ([]*Interval, error)

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

type DataSourceGroupBy

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

DataSourceGroupBy is the group-by builder for DataSource entities.

func (*DataSourceGroupBy) Aggregate

func (dsgb *DataSourceGroupBy) Aggregate(fns ...AggregateFunc) *DataSourceGroupBy

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

func (*DataSourceGroupBy) Bool

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

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

func (*DataSourceGroupBy) BoolX

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

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

func (*DataSourceGroupBy) Bools

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

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

func (*DataSourceGroupBy) BoolsX

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

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

func (*DataSourceGroupBy) Float64

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

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

func (*DataSourceGroupBy) Float64X

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

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

func (*DataSourceGroupBy) Float64s

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

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

func (*DataSourceGroupBy) Float64sX

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

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

func (*DataSourceGroupBy) Int

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

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

func (*DataSourceGroupBy) IntX

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

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

func (*DataSourceGroupBy) Ints

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

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

func (*DataSourceGroupBy) IntsX

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

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

func (*DataSourceGroupBy) Scan

func (dsgb *DataSourceGroupBy) Scan(ctx context.Context, v any) error

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

func (*DataSourceGroupBy) ScanX

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

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

func (*DataSourceGroupBy) String

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

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

func (*DataSourceGroupBy) StringX

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

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

func (*DataSourceGroupBy) Strings

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

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

func (*DataSourceGroupBy) StringsX

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

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

type DataSourceMutation

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

DataSourceMutation represents an operation that mutates the DataSource nodes in the graph.

func (*DataSourceMutation) AddField

func (m *DataSourceMutation) 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 (*DataSourceMutation) AddIntervalIDs

func (m *DataSourceMutation) AddIntervalIDs(ids ...int)

AddIntervalIDs adds the "intervals" edge to the Interval entity by ids.

func (*DataSourceMutation) AddedEdges

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

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

func (*DataSourceMutation) AddedField

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

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

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

func (*DataSourceMutation) AddedIDs

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

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

func (*DataSourceMutation) Address

func (m *DataSourceMutation) Address() (r string, exists bool)

Address returns the value of the "address" field in the mutation.

func (*DataSourceMutation) ClearEdge

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

func (m *DataSourceMutation) 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 (*DataSourceMutation) ClearIntervals

func (m *DataSourceMutation) ClearIntervals()

ClearIntervals clears the "intervals" edge to the Interval entity.

func (*DataSourceMutation) ClearedEdges

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

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

func (*DataSourceMutation) ClearedFields

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

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

func (DataSourceMutation) Client

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

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

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

func (*DataSourceMutation) Field

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

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

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

func (*DataSourceMutation) Fields

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

func (m *DataSourceMutation) 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 (*DataSourceMutation) IDs

func (m *DataSourceMutation) 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 (*DataSourceMutation) IntervalsCleared

func (m *DataSourceMutation) IntervalsCleared() bool

IntervalsCleared reports if the "intervals" edge to the Interval entity was cleared.

func (*DataSourceMutation) IntervalsIDs

func (m *DataSourceMutation) IntervalsIDs() (ids []int)

IntervalsIDs returns the "intervals" edge IDs in the mutation.

func (*DataSourceMutation) Name

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

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

func (*DataSourceMutation) OldAddress

func (m *DataSourceMutation) OldAddress(ctx context.Context) (v string, err error)

OldAddress returns the old "address" field's value of the DataSource entity. If the DataSource 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 (*DataSourceMutation) OldField

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

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

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

func (m *DataSourceMutation) Op() Op

Op returns the operation name.

func (*DataSourceMutation) RemoveIntervalIDs

func (m *DataSourceMutation) RemoveIntervalIDs(ids ...int)

RemoveIntervalIDs removes the "intervals" edge to the Interval entity by IDs.

func (*DataSourceMutation) RemovedEdges

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

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

func (*DataSourceMutation) RemovedIDs

func (m *DataSourceMutation) 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 (*DataSourceMutation) RemovedIntervalsIDs

func (m *DataSourceMutation) RemovedIntervalsIDs() (ids []int)

RemovedIntervals returns the removed IDs of the "intervals" edge to the Interval entity.

func (*DataSourceMutation) ResetAddress

func (m *DataSourceMutation) ResetAddress()

ResetAddress resets all changes to the "address" field.

func (*DataSourceMutation) ResetEdge

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

func (m *DataSourceMutation) 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 (*DataSourceMutation) ResetIntervals

func (m *DataSourceMutation) ResetIntervals()

ResetIntervals resets all changes to the "intervals" edge.

func (*DataSourceMutation) ResetName

func (m *DataSourceMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*DataSourceMutation) SetAddress

func (m *DataSourceMutation) SetAddress(s string)

SetAddress sets the "address" field.

func (*DataSourceMutation) SetField

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

func (m *DataSourceMutation) SetName(s string)

SetName sets the "name" field.

func (*DataSourceMutation) SetOp

func (m *DataSourceMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (DataSourceMutation) Tx

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

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

func (*DataSourceMutation) Type

func (m *DataSourceMutation) Type() string

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

func (*DataSourceMutation) Where

func (m *DataSourceMutation) Where(ps ...predicate.DataSource)

Where appends a list predicates to the DataSourceMutation builder.

func (*DataSourceMutation) WhereP

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

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

type DataSourceQuery

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

DataSourceQuery is the builder for querying DataSource entities.

func (*DataSourceQuery) Aggregate

func (dsq *DataSourceQuery) Aggregate(fns ...AggregateFunc) *DataSourceSelect

Aggregate returns a DataSourceSelect configured with the given aggregations.

func (*DataSourceQuery) All

func (dsq *DataSourceQuery) All(ctx context.Context) ([]*DataSource, error)

All executes the query and returns a list of DataSources.

func (*DataSourceQuery) AllX

func (dsq *DataSourceQuery) AllX(ctx context.Context) []*DataSource

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

func (*DataSourceQuery) Clone

func (dsq *DataSourceQuery) Clone() *DataSourceQuery

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

func (*DataSourceQuery) Count

func (dsq *DataSourceQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*DataSourceQuery) CountX

func (dsq *DataSourceQuery) CountX(ctx context.Context) int

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

func (*DataSourceQuery) Exist

func (dsq *DataSourceQuery) Exist(ctx context.Context) (bool, error)

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

func (*DataSourceQuery) ExistX

func (dsq *DataSourceQuery) ExistX(ctx context.Context) bool

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

func (*DataSourceQuery) First

func (dsq *DataSourceQuery) First(ctx context.Context) (*DataSource, error)

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

func (*DataSourceQuery) FirstID

func (dsq *DataSourceQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*DataSourceQuery) FirstIDX

func (dsq *DataSourceQuery) FirstIDX(ctx context.Context) int

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

func (*DataSourceQuery) FirstX

func (dsq *DataSourceQuery) FirstX(ctx context.Context) *DataSource

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

func (*DataSourceQuery) GroupBy

func (dsq *DataSourceQuery) GroupBy(field string, fields ...string) *DataSourceGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Name string `json:"name,omitempty"`
	Count int `json:"count,omitempty"`
}

client.DataSource.Query().
	GroupBy(datasource.FieldName).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*DataSourceQuery) IDs

func (dsq *DataSourceQuery) IDs(ctx context.Context) ([]int, error)

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

func (*DataSourceQuery) IDsX

func (dsq *DataSourceQuery) IDsX(ctx context.Context) []int

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

func (*DataSourceQuery) Limit

func (dsq *DataSourceQuery) Limit(limit int) *DataSourceQuery

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

func (*DataSourceQuery) Offset

func (dsq *DataSourceQuery) Offset(offset int) *DataSourceQuery

Offset to start from.

func (*DataSourceQuery) Only

func (dsq *DataSourceQuery) Only(ctx context.Context) (*DataSource, error)

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

func (*DataSourceQuery) OnlyID

func (dsq *DataSourceQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*DataSourceQuery) OnlyIDX

func (dsq *DataSourceQuery) OnlyIDX(ctx context.Context) int

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

func (*DataSourceQuery) OnlyX

func (dsq *DataSourceQuery) OnlyX(ctx context.Context) *DataSource

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

func (*DataSourceQuery) Order

func (dsq *DataSourceQuery) Order(o ...OrderFunc) *DataSourceQuery

Order specifies how the records should be ordered.

func (*DataSourceQuery) QueryIntervals

func (dsq *DataSourceQuery) QueryIntervals() *IntervalQuery

QueryIntervals chains the current query on the "intervals" edge.

func (*DataSourceQuery) Select

func (dsq *DataSourceQuery) Select(fields ...string) *DataSourceSelect

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

Example:

var v []struct {
	Name string `json:"name,omitempty"`
}

client.DataSource.Query().
	Select(datasource.FieldName).
	Scan(ctx, &v)

func (*DataSourceQuery) Unique

func (dsq *DataSourceQuery) Unique(unique bool) *DataSourceQuery

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

Where adds a new predicate for the DataSourceQuery builder.

func (*DataSourceQuery) WithIntervals

func (dsq *DataSourceQuery) WithIntervals(opts ...func(*IntervalQuery)) *DataSourceQuery

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

type DataSourceSelect

type DataSourceSelect struct {
	*DataSourceQuery
	// contains filtered or unexported fields
}

DataSourceSelect is the builder for selecting fields of DataSource entities.

func (*DataSourceSelect) Aggregate

func (dss *DataSourceSelect) Aggregate(fns ...AggregateFunc) *DataSourceSelect

Aggregate adds the given aggregation functions to the selector query.

func (*DataSourceSelect) Bool

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

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

func (*DataSourceSelect) BoolX

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

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

func (*DataSourceSelect) Bools

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

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

func (*DataSourceSelect) BoolsX

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

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

func (*DataSourceSelect) Float64

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

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

func (*DataSourceSelect) Float64X

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

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

func (*DataSourceSelect) Float64s

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

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

func (*DataSourceSelect) Float64sX

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

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

func (*DataSourceSelect) Int

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

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

func (*DataSourceSelect) IntX

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

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

func (*DataSourceSelect) Ints

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

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

func (*DataSourceSelect) IntsX

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

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

func (*DataSourceSelect) Scan

func (dss *DataSourceSelect) Scan(ctx context.Context, v any) error

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

func (*DataSourceSelect) ScanX

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

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

func (*DataSourceSelect) String

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

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

func (*DataSourceSelect) StringX

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

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

func (*DataSourceSelect) Strings

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

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

func (*DataSourceSelect) StringsX

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

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

type DataSourceUpdate

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

DataSourceUpdate is the builder for updating DataSource entities.

func (*DataSourceUpdate) AddIntervalIDs

func (dsu *DataSourceUpdate) AddIntervalIDs(ids ...int) *DataSourceUpdate

AddIntervalIDs adds the "intervals" edge to the Interval entity by IDs.

func (*DataSourceUpdate) AddIntervals

func (dsu *DataSourceUpdate) AddIntervals(i ...*Interval) *DataSourceUpdate

AddIntervals adds the "intervals" edges to the Interval entity.

func (*DataSourceUpdate) ClearIntervals

func (dsu *DataSourceUpdate) ClearIntervals() *DataSourceUpdate

ClearIntervals clears all "intervals" edges to the Interval entity.

func (*DataSourceUpdate) Exec

func (dsu *DataSourceUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*DataSourceUpdate) ExecX

func (dsu *DataSourceUpdate) ExecX(ctx context.Context)

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

func (*DataSourceUpdate) Mutation

func (dsu *DataSourceUpdate) Mutation() *DataSourceMutation

Mutation returns the DataSourceMutation object of the builder.

func (*DataSourceUpdate) RemoveIntervalIDs

func (dsu *DataSourceUpdate) RemoveIntervalIDs(ids ...int) *DataSourceUpdate

RemoveIntervalIDs removes the "intervals" edge to Interval entities by IDs.

func (*DataSourceUpdate) RemoveIntervals

func (dsu *DataSourceUpdate) RemoveIntervals(i ...*Interval) *DataSourceUpdate

RemoveIntervals removes "intervals" edges to Interval entities.

func (*DataSourceUpdate) Save

func (dsu *DataSourceUpdate) Save(ctx context.Context) (int, error)

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

func (*DataSourceUpdate) SaveX

func (dsu *DataSourceUpdate) SaveX(ctx context.Context) int

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

func (*DataSourceUpdate) SetAddress

func (dsu *DataSourceUpdate) SetAddress(s string) *DataSourceUpdate

SetAddress sets the "address" field.

func (*DataSourceUpdate) SetName

func (dsu *DataSourceUpdate) SetName(s string) *DataSourceUpdate

SetName sets the "name" field.

func (*DataSourceUpdate) SetNillableAddress

func (dsu *DataSourceUpdate) SetNillableAddress(s *string) *DataSourceUpdate

SetNillableAddress sets the "address" field if the given value is not nil.

func (*DataSourceUpdate) Where

Where appends a list predicates to the DataSourceUpdate builder.

type DataSourceUpdateOne

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

DataSourceUpdateOne is the builder for updating a single DataSource entity.

func (*DataSourceUpdateOne) AddIntervalIDs

func (dsuo *DataSourceUpdateOne) AddIntervalIDs(ids ...int) *DataSourceUpdateOne

AddIntervalIDs adds the "intervals" edge to the Interval entity by IDs.

func (*DataSourceUpdateOne) AddIntervals

func (dsuo *DataSourceUpdateOne) AddIntervals(i ...*Interval) *DataSourceUpdateOne

AddIntervals adds the "intervals" edges to the Interval entity.

func (*DataSourceUpdateOne) ClearIntervals

func (dsuo *DataSourceUpdateOne) ClearIntervals() *DataSourceUpdateOne

ClearIntervals clears all "intervals" edges to the Interval entity.

func (*DataSourceUpdateOne) Exec

func (dsuo *DataSourceUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*DataSourceUpdateOne) ExecX

func (dsuo *DataSourceUpdateOne) ExecX(ctx context.Context)

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

func (*DataSourceUpdateOne) Mutation

func (dsuo *DataSourceUpdateOne) Mutation() *DataSourceMutation

Mutation returns the DataSourceMutation object of the builder.

func (*DataSourceUpdateOne) RemoveIntervalIDs

func (dsuo *DataSourceUpdateOne) RemoveIntervalIDs(ids ...int) *DataSourceUpdateOne

RemoveIntervalIDs removes the "intervals" edge to Interval entities by IDs.

func (*DataSourceUpdateOne) RemoveIntervals

func (dsuo *DataSourceUpdateOne) RemoveIntervals(i ...*Interval) *DataSourceUpdateOne

RemoveIntervals removes "intervals" edges to Interval entities.

func (*DataSourceUpdateOne) Save

func (dsuo *DataSourceUpdateOne) Save(ctx context.Context) (*DataSource, error)

Save executes the query and returns the updated DataSource entity.

func (*DataSourceUpdateOne) SaveX

func (dsuo *DataSourceUpdateOne) SaveX(ctx context.Context) *DataSource

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

func (*DataSourceUpdateOne) Select

func (dsuo *DataSourceUpdateOne) Select(field string, fields ...string) *DataSourceUpdateOne

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

func (*DataSourceUpdateOne) SetAddress

func (dsuo *DataSourceUpdateOne) SetAddress(s string) *DataSourceUpdateOne

SetAddress sets the "address" field.

func (*DataSourceUpdateOne) SetName

SetName sets the "name" field.

func (*DataSourceUpdateOne) SetNillableAddress

func (dsuo *DataSourceUpdateOne) SetNillableAddress(s *string) *DataSourceUpdateOne

SetNillableAddress sets the "address" field if the given value is not nil.

type DataSources

type DataSources []*DataSource

DataSources is a parsable slice of DataSource.

type Dividend

type Dividend struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CashAmount holds the value of the "cash_amount" field.
	CashAmount float64 `json:"cash_amount,omitempty"`
	// DeclarationDate holds the value of the "declaration_date" field.
	DeclarationDate time.Time `json:"declaration_date,omitempty"`
	// DividendType holds the value of the "dividend_type" field.
	DividendType dividend.DividendType `json:"dividend_type,omitempty"`
	// ExDividendDate holds the value of the "ex_dividend_date" field.
	ExDividendDate time.Time `json:"ex_dividend_date,omitempty"`
	// Frequency holds the value of the "frequency" field.
	Frequency int `json:"frequency,omitempty"`
	// RecordDate holds the value of the "record_date" field.
	RecordDate time.Time `json:"record_date,omitempty"`
	// PayDate holds the value of the "pay_date" field.
	PayDate time.Time `json:"pay_date,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the DividendQuery when eager-loading is set.
	Edges DividendEdges `json:"edges"`
	// contains filtered or unexported fields
}

Dividend is the model entity for the Dividend schema.

func (*Dividend) QueryStock

func (d *Dividend) QueryStock() *EntityQuery

QueryStock queries the "stock" edge of the Dividend entity.

func (*Dividend) String

func (d *Dividend) String() string

String implements the fmt.Stringer.

func (*Dividend) Unwrap

func (d *Dividend) Unwrap() *Dividend

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

func (d *Dividend) Update() *DividendUpdateOne

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

type DividendClient

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

DividendClient is a client for the Dividend schema.

func NewDividendClient

func NewDividendClient(c config) *DividendClient

NewDividendClient returns a client for the Dividend from the given config.

func (*DividendClient) Create

func (c *DividendClient) Create() *DividendCreate

Create returns a builder for creating a Dividend entity.

func (*DividendClient) CreateBulk

func (c *DividendClient) CreateBulk(builders ...*DividendCreate) *DividendCreateBulk

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

func (*DividendClient) Delete

func (c *DividendClient) Delete() *DividendDelete

Delete returns a delete builder for Dividend.

func (*DividendClient) DeleteOne

func (c *DividendClient) DeleteOne(d *Dividend) *DividendDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*DividendClient) DeleteOneID

func (c *DividendClient) DeleteOneID(id int) *DividendDeleteOne

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

func (*DividendClient) Get

func (c *DividendClient) Get(ctx context.Context, id int) (*Dividend, error)

Get returns a Dividend entity by its id.

func (*DividendClient) GetX

func (c *DividendClient) GetX(ctx context.Context, id int) *Dividend

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

func (*DividendClient) Hooks

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

Hooks returns the client hooks.

func (*DividendClient) Intercept

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

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

func (*DividendClient) Interceptors

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

Interceptors returns the client interceptors.

func (*DividendClient) Query

func (c *DividendClient) Query() *DividendQuery

Query returns a query builder for Dividend.

func (*DividendClient) QueryStock

func (c *DividendClient) QueryStock(d *Dividend) *EntityQuery

QueryStock queries the stock edge of a Dividend.

func (*DividendClient) Update

func (c *DividendClient) Update() *DividendUpdate

Update returns an update builder for Dividend.

func (*DividendClient) UpdateOne

func (c *DividendClient) UpdateOne(d *Dividend) *DividendUpdateOne

UpdateOne returns an update builder for the given entity.

func (*DividendClient) UpdateOneID

func (c *DividendClient) UpdateOneID(id int) *DividendUpdateOne

UpdateOneID returns an update builder for the given id.

func (*DividendClient) Use

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

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

type DividendCreate

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

DividendCreate is the builder for creating a Dividend entity.

func (*DividendCreate) AddStock

func (dc *DividendCreate) AddStock(e ...*Entity) *DividendCreate

AddStock adds the "stock" edges to the Entity entity.

func (*DividendCreate) AddStockIDs

func (dc *DividendCreate) AddStockIDs(ids ...int) *DividendCreate

AddStockIDs adds the "stock" edge to the Entity entity by IDs.

func (*DividendCreate) Exec

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

Exec executes the query.

func (*DividendCreate) ExecX

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

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

func (*DividendCreate) Mutation

func (dc *DividendCreate) Mutation() *DividendMutation

Mutation returns the DividendMutation object of the builder.

func (*DividendCreate) Save

func (dc *DividendCreate) Save(ctx context.Context) (*Dividend, error)

Save creates the Dividend in the database.

func (*DividendCreate) SaveX

func (dc *DividendCreate) SaveX(ctx context.Context) *Dividend

SaveX calls Save and panics if Save returns an error.

func (*DividendCreate) SetCashAmount

func (dc *DividendCreate) SetCashAmount(f float64) *DividendCreate

SetCashAmount sets the "cash_amount" field.

func (*DividendCreate) SetDeclarationDate

func (dc *DividendCreate) SetDeclarationDate(t time.Time) *DividendCreate

SetDeclarationDate sets the "declaration_date" field.

func (*DividendCreate) SetDividendType

func (dc *DividendCreate) SetDividendType(dt dividend.DividendType) *DividendCreate

SetDividendType sets the "dividend_type" field.

func (*DividendCreate) SetExDividendDate

func (dc *DividendCreate) SetExDividendDate(t time.Time) *DividendCreate

SetExDividendDate sets the "ex_dividend_date" field.

func (*DividendCreate) SetFrequency

func (dc *DividendCreate) SetFrequency(i int) *DividendCreate

SetFrequency sets the "frequency" field.

func (*DividendCreate) SetPayDate

func (dc *DividendCreate) SetPayDate(t time.Time) *DividendCreate

SetPayDate sets the "pay_date" field.

func (*DividendCreate) SetRecordDate

func (dc *DividendCreate) SetRecordDate(t time.Time) *DividendCreate

SetRecordDate sets the "record_date" field.

type DividendCreateBulk

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

DividendCreateBulk is the builder for creating many Dividend entities in bulk.

func (*DividendCreateBulk) Exec

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

Exec executes the query.

func (*DividendCreateBulk) ExecX

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

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

func (*DividendCreateBulk) Save

func (dcb *DividendCreateBulk) Save(ctx context.Context) ([]*Dividend, error)

Save creates the Dividend entities in the database.

func (*DividendCreateBulk) SaveX

func (dcb *DividendCreateBulk) SaveX(ctx context.Context) []*Dividend

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

type DividendDelete

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

DividendDelete is the builder for deleting a Dividend entity.

func (*DividendDelete) Exec

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

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

func (*DividendDelete) ExecX

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

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

func (*DividendDelete) Where

func (dd *DividendDelete) Where(ps ...predicate.Dividend) *DividendDelete

Where appends a list predicates to the DividendDelete builder.

type DividendDeleteOne

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

DividendDeleteOne is the builder for deleting a single Dividend entity.

func (*DividendDeleteOne) Exec

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

Exec executes the deletion query.

func (*DividendDeleteOne) ExecX

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

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

type DividendEdges

type DividendEdges struct {
	// Stock holds the value of the stock edge.
	Stock []*Entity `json:"stock,omitempty"`
	// contains filtered or unexported fields
}

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

func (DividendEdges) StockOrErr

func (e DividendEdges) StockOrErr() ([]*Entity, error)

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

type DividendGroupBy

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

DividendGroupBy is the group-by builder for Dividend entities.

func (*DividendGroupBy) Aggregate

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

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

func (*DividendGroupBy) Bool

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

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

func (*DividendGroupBy) BoolX

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

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

func (*DividendGroupBy) Bools

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

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

func (*DividendGroupBy) BoolsX

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

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

func (*DividendGroupBy) Float64

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

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

func (*DividendGroupBy) Float64X

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

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

func (*DividendGroupBy) Float64s

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

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

func (*DividendGroupBy) Float64sX

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

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

func (*DividendGroupBy) Int

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

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

func (*DividendGroupBy) IntX

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

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

func (*DividendGroupBy) Ints

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

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

func (*DividendGroupBy) IntsX

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

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

func (*DividendGroupBy) Scan

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

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

func (*DividendGroupBy) ScanX

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

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

func (*DividendGroupBy) String

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

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

func (*DividendGroupBy) StringX

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

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

func (*DividendGroupBy) Strings

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

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

func (*DividendGroupBy) StringsX

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

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

type DividendMutation

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

DividendMutation represents an operation that mutates the Dividend nodes in the graph.

func (*DividendMutation) AddCashAmount

func (m *DividendMutation) AddCashAmount(f float64)

AddCashAmount adds f to the "cash_amount" field.

func (*DividendMutation) AddField

func (m *DividendMutation) 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 (*DividendMutation) AddFrequency

func (m *DividendMutation) AddFrequency(i int)

AddFrequency adds i to the "frequency" field.

func (*DividendMutation) AddStockIDs

func (m *DividendMutation) AddStockIDs(ids ...int)

AddStockIDs adds the "stock" edge to the Entity entity by ids.

func (*DividendMutation) AddedCashAmount

func (m *DividendMutation) AddedCashAmount() (r float64, exists bool)

AddedCashAmount returns the value that was added to the "cash_amount" field in this mutation.

func (*DividendMutation) AddedEdges

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

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

func (*DividendMutation) AddedField

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

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

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

func (*DividendMutation) AddedFrequency

func (m *DividendMutation) AddedFrequency() (r int, exists bool)

AddedFrequency returns the value that was added to the "frequency" field in this mutation.

func (*DividendMutation) AddedIDs

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

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

func (*DividendMutation) CashAmount

func (m *DividendMutation) CashAmount() (r float64, exists bool)

CashAmount returns the value of the "cash_amount" field in the mutation.

func (*DividendMutation) ClearEdge

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

func (m *DividendMutation) 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 (*DividendMutation) ClearStock

func (m *DividendMutation) ClearStock()

ClearStock clears the "stock" edge to the Entity entity.

func (*DividendMutation) ClearedEdges

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

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

func (*DividendMutation) ClearedFields

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

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

func (DividendMutation) Client

func (m DividendMutation) 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 (*DividendMutation) DeclarationDate

func (m *DividendMutation) DeclarationDate() (r time.Time, exists bool)

DeclarationDate returns the value of the "declaration_date" field in the mutation.

func (*DividendMutation) DividendType

func (m *DividendMutation) DividendType() (r dividend.DividendType, exists bool)

DividendType returns the value of the "dividend_type" field in the mutation.

func (*DividendMutation) EdgeCleared

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

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

func (*DividendMutation) ExDividendDate

func (m *DividendMutation) ExDividendDate() (r time.Time, exists bool)

ExDividendDate returns the value of the "ex_dividend_date" field in the mutation.

func (*DividendMutation) Field

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

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

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

func (*DividendMutation) Fields

func (m *DividendMutation) 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 (*DividendMutation) Frequency

func (m *DividendMutation) Frequency() (r int, exists bool)

Frequency returns the value of the "frequency" field in the mutation.

func (*DividendMutation) ID

func (m *DividendMutation) 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 (*DividendMutation) IDs

func (m *DividendMutation) 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 (*DividendMutation) OldCashAmount

func (m *DividendMutation) OldCashAmount(ctx context.Context) (v float64, err error)

OldCashAmount returns the old "cash_amount" field's value of the Dividend entity. If the Dividend 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 (*DividendMutation) OldDeclarationDate

func (m *DividendMutation) OldDeclarationDate(ctx context.Context) (v time.Time, err error)

OldDeclarationDate returns the old "declaration_date" field's value of the Dividend entity. If the Dividend 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 (*DividendMutation) OldDividendType

func (m *DividendMutation) OldDividendType(ctx context.Context) (v dividend.DividendType, err error)

OldDividendType returns the old "dividend_type" field's value of the Dividend entity. If the Dividend 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 (*DividendMutation) OldExDividendDate

func (m *DividendMutation) OldExDividendDate(ctx context.Context) (v time.Time, err error)

OldExDividendDate returns the old "ex_dividend_date" field's value of the Dividend entity. If the Dividend 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 (*DividendMutation) OldField

func (m *DividendMutation) 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 (*DividendMutation) OldFrequency

func (m *DividendMutation) OldFrequency(ctx context.Context) (v int, err error)

OldFrequency returns the old "frequency" field's value of the Dividend entity. If the Dividend 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 (*DividendMutation) OldPayDate

func (m *DividendMutation) OldPayDate(ctx context.Context) (v time.Time, err error)

OldPayDate returns the old "pay_date" field's value of the Dividend entity. If the Dividend 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 (*DividendMutation) OldRecordDate

func (m *DividendMutation) OldRecordDate(ctx context.Context) (v time.Time, err error)

OldRecordDate returns the old "record_date" field's value of the Dividend entity. If the Dividend 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 (*DividendMutation) Op

func (m *DividendMutation) Op() Op

Op returns the operation name.

func (*DividendMutation) PayDate

func (m *DividendMutation) PayDate() (r time.Time, exists bool)

PayDate returns the value of the "pay_date" field in the mutation.

func (*DividendMutation) RecordDate

func (m *DividendMutation) RecordDate() (r time.Time, exists bool)

RecordDate returns the value of the "record_date" field in the mutation.

func (*DividendMutation) RemoveStockIDs

func (m *DividendMutation) RemoveStockIDs(ids ...int)

RemoveStockIDs removes the "stock" edge to the Entity entity by IDs.

func (*DividendMutation) RemovedEdges

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

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

func (*DividendMutation) RemovedIDs

func (m *DividendMutation) 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 (*DividendMutation) RemovedStockIDs

func (m *DividendMutation) RemovedStockIDs() (ids []int)

RemovedStock returns the removed IDs of the "stock" edge to the Entity entity.

func (*DividendMutation) ResetCashAmount

func (m *DividendMutation) ResetCashAmount()

ResetCashAmount resets all changes to the "cash_amount" field.

func (*DividendMutation) ResetDeclarationDate

func (m *DividendMutation) ResetDeclarationDate()

ResetDeclarationDate resets all changes to the "declaration_date" field.

func (*DividendMutation) ResetDividendType

func (m *DividendMutation) ResetDividendType()

ResetDividendType resets all changes to the "dividend_type" field.

func (*DividendMutation) ResetEdge

func (m *DividendMutation) 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 (*DividendMutation) ResetExDividendDate

func (m *DividendMutation) ResetExDividendDate()

ResetExDividendDate resets all changes to the "ex_dividend_date" field.

func (*DividendMutation) ResetField

func (m *DividendMutation) 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 (*DividendMutation) ResetFrequency

func (m *DividendMutation) ResetFrequency()

ResetFrequency resets all changes to the "frequency" field.

func (*DividendMutation) ResetPayDate

func (m *DividendMutation) ResetPayDate()

ResetPayDate resets all changes to the "pay_date" field.

func (*DividendMutation) ResetRecordDate

func (m *DividendMutation) ResetRecordDate()

ResetRecordDate resets all changes to the "record_date" field.

func (*DividendMutation) ResetStock

func (m *DividendMutation) ResetStock()

ResetStock resets all changes to the "stock" edge.

func (*DividendMutation) SetCashAmount

func (m *DividendMutation) SetCashAmount(f float64)

SetCashAmount sets the "cash_amount" field.

func (*DividendMutation) SetDeclarationDate

func (m *DividendMutation) SetDeclarationDate(t time.Time)

SetDeclarationDate sets the "declaration_date" field.

func (*DividendMutation) SetDividendType

func (m *DividendMutation) SetDividendType(dt dividend.DividendType)

SetDividendType sets the "dividend_type" field.

func (*DividendMutation) SetExDividendDate

func (m *DividendMutation) SetExDividendDate(t time.Time)

SetExDividendDate sets the "ex_dividend_date" field.

func (*DividendMutation) SetField

func (m *DividendMutation) 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 (*DividendMutation) SetFrequency

func (m *DividendMutation) SetFrequency(i int)

SetFrequency sets the "frequency" field.

func (*DividendMutation) SetOp

func (m *DividendMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*DividendMutation) SetPayDate

func (m *DividendMutation) SetPayDate(t time.Time)

SetPayDate sets the "pay_date" field.

func (*DividendMutation) SetRecordDate

func (m *DividendMutation) SetRecordDate(t time.Time)

SetRecordDate sets the "record_date" field.

func (*DividendMutation) StockCleared

func (m *DividendMutation) StockCleared() bool

StockCleared reports if the "stock" edge to the Entity entity was cleared.

func (*DividendMutation) StockIDs

func (m *DividendMutation) StockIDs() (ids []int)

StockIDs returns the "stock" edge IDs in the mutation.

func (DividendMutation) Tx

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

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

func (*DividendMutation) Type

func (m *DividendMutation) Type() string

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

func (*DividendMutation) Where

func (m *DividendMutation) Where(ps ...predicate.Dividend)

Where appends a list predicates to the DividendMutation builder.

func (*DividendMutation) WhereP

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

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

type DividendQuery

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

DividendQuery is the builder for querying Dividend entities.

func (*DividendQuery) Aggregate

func (dq *DividendQuery) Aggregate(fns ...AggregateFunc) *DividendSelect

Aggregate returns a DividendSelect configured with the given aggregations.

func (*DividendQuery) All

func (dq *DividendQuery) All(ctx context.Context) ([]*Dividend, error)

All executes the query and returns a list of Dividends.

func (*DividendQuery) AllX

func (dq *DividendQuery) AllX(ctx context.Context) []*Dividend

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

func (*DividendQuery) Clone

func (dq *DividendQuery) Clone() *DividendQuery

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

func (*DividendQuery) Count

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

Count returns the count of the given query.

func (*DividendQuery) CountX

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

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

func (*DividendQuery) Exist

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

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

func (*DividendQuery) ExistX

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

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

func (*DividendQuery) First

func (dq *DividendQuery) First(ctx context.Context) (*Dividend, error)

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

func (*DividendQuery) FirstID

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

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

func (*DividendQuery) FirstIDX

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

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

func (*DividendQuery) FirstX

func (dq *DividendQuery) FirstX(ctx context.Context) *Dividend

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

func (*DividendQuery) GroupBy

func (dq *DividendQuery) GroupBy(field string, fields ...string) *DividendGroupBy

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 {
	CashAmount float64 `json:"cash_amount,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Dividend.Query().
	GroupBy(dividend.FieldCashAmount).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*DividendQuery) IDs

func (dq *DividendQuery) IDs(ctx context.Context) ([]int, error)

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

func (*DividendQuery) IDsX

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

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

func (*DividendQuery) Limit

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

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

func (*DividendQuery) Offset

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

Offset to start from.

func (*DividendQuery) Only

func (dq *DividendQuery) Only(ctx context.Context) (*Dividend, error)

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

func (*DividendQuery) OnlyID

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

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

func (*DividendQuery) OnlyIDX

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

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

func (*DividendQuery) OnlyX

func (dq *DividendQuery) OnlyX(ctx context.Context) *Dividend

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

func (*DividendQuery) Order

func (dq *DividendQuery) Order(o ...OrderFunc) *DividendQuery

Order specifies how the records should be ordered.

func (*DividendQuery) QueryStock

func (dq *DividendQuery) QueryStock() *EntityQuery

QueryStock chains the current query on the "stock" edge.

func (*DividendQuery) Select

func (dq *DividendQuery) Select(fields ...string) *DividendSelect

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 {
	CashAmount float64 `json:"cash_amount,omitempty"`
}

client.Dividend.Query().
	Select(dividend.FieldCashAmount).
	Scan(ctx, &v)

func (*DividendQuery) Unique

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

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

func (dq *DividendQuery) Where(ps ...predicate.Dividend) *DividendQuery

Where adds a new predicate for the DividendQuery builder.

func (*DividendQuery) WithStock

func (dq *DividendQuery) WithStock(opts ...func(*EntityQuery)) *DividendQuery

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

type DividendSelect

type DividendSelect struct {
	*DividendQuery
	// contains filtered or unexported fields
}

DividendSelect is the builder for selecting fields of Dividend entities.

func (*DividendSelect) Aggregate

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

Aggregate adds the given aggregation functions to the selector query.

func (*DividendSelect) Bool

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

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

func (*DividendSelect) BoolX

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

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

func (*DividendSelect) Bools

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

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

func (*DividendSelect) BoolsX

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

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

func (*DividendSelect) Float64

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

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

func (*DividendSelect) Float64X

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

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

func (*DividendSelect) Float64s

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

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

func (*DividendSelect) Float64sX

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

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

func (*DividendSelect) Int

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

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

func (*DividendSelect) IntX

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

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

func (*DividendSelect) Ints

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

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

func (*DividendSelect) IntsX

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

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

func (*DividendSelect) Scan

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

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

func (*DividendSelect) ScanX

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

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

func (*DividendSelect) String

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

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

func (*DividendSelect) StringX

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

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

func (*DividendSelect) Strings

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

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*DividendSelect) StringsX

func (s *DividendSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type DividendUpdate

type DividendUpdate struct {
	// contains filtered or unexported fields
}

DividendUpdate is the builder for updating Dividend entities.

func (*DividendUpdate) AddCashAmount

func (du *DividendUpdate) AddCashAmount(f float64) *DividendUpdate

AddCashAmount adds f to the "cash_amount" field.

func (*DividendUpdate) AddFrequency

func (du *DividendUpdate) AddFrequency(i int) *DividendUpdate

AddFrequency adds i to the "frequency" field.

func (*DividendUpdate) AddStock

func (du *DividendUpdate) AddStock(e ...*Entity) *DividendUpdate

AddStock adds the "stock" edges to the Entity entity.

func (*DividendUpdate) AddStockIDs

func (du *DividendUpdate) AddStockIDs(ids ...int) *DividendUpdate

AddStockIDs adds the "stock" edge to the Entity entity by IDs.

func (*DividendUpdate) ClearStock

func (du *DividendUpdate) ClearStock() *DividendUpdate

ClearStock clears all "stock" edges to the Entity entity.

func (*DividendUpdate) Exec

func (du *DividendUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*DividendUpdate) ExecX

func (du *DividendUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DividendUpdate) Mutation

func (du *DividendUpdate) Mutation() *DividendMutation

Mutation returns the DividendMutation object of the builder.

func (*DividendUpdate) RemoveStock

func (du *DividendUpdate) RemoveStock(e ...*Entity) *DividendUpdate

RemoveStock removes "stock" edges to Entity entities.

func (*DividendUpdate) RemoveStockIDs

func (du *DividendUpdate) RemoveStockIDs(ids ...int) *DividendUpdate

RemoveStockIDs removes the "stock" edge to Entity entities by IDs.

func (*DividendUpdate) Save

func (du *DividendUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*DividendUpdate) SaveX

func (du *DividendUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*DividendUpdate) SetCashAmount

func (du *DividendUpdate) SetCashAmount(f float64) *DividendUpdate

SetCashAmount sets the "cash_amount" field.

func (*DividendUpdate) SetDeclarationDate

func (du *DividendUpdate) SetDeclarationDate(t time.Time) *DividendUpdate

SetDeclarationDate sets the "declaration_date" field.

func (*DividendUpdate) SetDividendType

func (du *DividendUpdate) SetDividendType(dt dividend.DividendType) *DividendUpdate

SetDividendType sets the "dividend_type" field.

func (*DividendUpdate) SetExDividendDate

func (du *DividendUpdate) SetExDividendDate(t time.Time) *DividendUpdate

SetExDividendDate sets the "ex_dividend_date" field.

func (*DividendUpdate) SetFrequency

func (du *DividendUpdate) SetFrequency(i int) *DividendUpdate

SetFrequency sets the "frequency" field.

func (*DividendUpdate) SetPayDate

func (du *DividendUpdate) SetPayDate(t time.Time) *DividendUpdate

SetPayDate sets the "pay_date" field.

func (*DividendUpdate) SetRecordDate

func (du *DividendUpdate) SetRecordDate(t time.Time) *DividendUpdate

SetRecordDate sets the "record_date" field.

func (*DividendUpdate) Where

func (du *DividendUpdate) Where(ps ...predicate.Dividend) *DividendUpdate

Where appends a list predicates to the DividendUpdate builder.

type DividendUpdateOne

type DividendUpdateOne struct {
	// contains filtered or unexported fields
}

DividendUpdateOne is the builder for updating a single Dividend entity.

func (*DividendUpdateOne) AddCashAmount

func (duo *DividendUpdateOne) AddCashAmount(f float64) *DividendUpdateOne

AddCashAmount adds f to the "cash_amount" field.

func (*DividendUpdateOne) AddFrequency

func (duo *DividendUpdateOne) AddFrequency(i int) *DividendUpdateOne

AddFrequency adds i to the "frequency" field.

func (*DividendUpdateOne) AddStock

func (duo *DividendUpdateOne) AddStock(e ...*Entity) *DividendUpdateOne

AddStock adds the "stock" edges to the Entity entity.

func (*DividendUpdateOne) AddStockIDs

func (duo *DividendUpdateOne) AddStockIDs(ids ...int) *DividendUpdateOne

AddStockIDs adds the "stock" edge to the Entity entity by IDs.

func (*DividendUpdateOne) ClearStock

func (duo *DividendUpdateOne) ClearStock() *DividendUpdateOne

ClearStock clears all "stock" edges to the Entity entity.

func (*DividendUpdateOne) Exec

func (duo *DividendUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*DividendUpdateOne) ExecX

func (duo *DividendUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*DividendUpdateOne) Mutation

func (duo *DividendUpdateOne) Mutation() *DividendMutation

Mutation returns the DividendMutation object of the builder.

func (*DividendUpdateOne) RemoveStock

func (duo *DividendUpdateOne) RemoveStock(e ...*Entity) *DividendUpdateOne

RemoveStock removes "stock" edges to Entity entities.

func (*DividendUpdateOne) RemoveStockIDs

func (duo *DividendUpdateOne) RemoveStockIDs(ids ...int) *DividendUpdateOne

RemoveStockIDs removes the "stock" edge to Entity entities by IDs.

func (*DividendUpdateOne) Save

func (duo *DividendUpdateOne) Save(ctx context.Context) (*Dividend, error)

Save executes the query and returns the updated Dividend entity.

func (*DividendUpdateOne) SaveX

func (duo *DividendUpdateOne) SaveX(ctx context.Context) *Dividend

SaveX is like Save, but panics if an error occurs.

func (*DividendUpdateOne) Select

func (duo *DividendUpdateOne) Select(field string, fields ...string) *DividendUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*DividendUpdateOne) SetCashAmount

func (duo *DividendUpdateOne) SetCashAmount(f float64) *DividendUpdateOne

SetCashAmount sets the "cash_amount" field.

func (*DividendUpdateOne) SetDeclarationDate

func (duo *DividendUpdateOne) SetDeclarationDate(t time.Time) *DividendUpdateOne

SetDeclarationDate sets the "declaration_date" field.

func (*DividendUpdateOne) SetDividendType

func (duo *DividendUpdateOne) SetDividendType(dt dividend.DividendType) *DividendUpdateOne

SetDividendType sets the "dividend_type" field.

func (*DividendUpdateOne) SetExDividendDate

func (duo *DividendUpdateOne) SetExDividendDate(t time.Time) *DividendUpdateOne

SetExDividendDate sets the "ex_dividend_date" field.

func (*DividendUpdateOne) SetFrequency

func (duo *DividendUpdateOne) SetFrequency(i int) *DividendUpdateOne

SetFrequency sets the "frequency" field.

func (*DividendUpdateOne) SetPayDate

func (duo *DividendUpdateOne) SetPayDate(t time.Time) *DividendUpdateOne

SetPayDate sets the "pay_date" field.

func (*DividendUpdateOne) SetRecordDate

func (duo *DividendUpdateOne) SetRecordDate(t time.Time) *DividendUpdateOne

SetRecordDate sets the "record_date" field.

type Dividends

type Dividends []*Dividend

Dividends is a parsable slice of Dividend.

type Entities

type Entities []*Entity

Entities is a parsable slice of Entity.

type Entity

type Entity struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Active holds the value of the "active" field.
	Active bool `json:"active,omitempty"`
	// Ticker holds the value of the "ticker" field.
	Ticker string `json:"ticker,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// ListDate holds the value of the "list_date" field.
	ListDate time.Time `json:"list_date,omitempty"`
	// Delisted holds the value of the "delisted" field.
	Delisted *time.Time `json:"delisted,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the EntityQuery when eager-loading is set.
	Edges EntityEdges `json:"edges"`
	// contains filtered or unexported fields
}

Entity is the model entity for the Entity schema.

func (*Entity) QueryDividends

func (e *Entity) QueryDividends() *DividendQuery

QueryDividends queries the "dividends" edge of the Entity entity.

func (*Entity) QueryExchanges

func (e *Entity) QueryExchanges() *ExchangeQuery

QueryExchanges queries the "exchanges" edge of the Entity entity.

func (*Entity) QueryFinancials

func (e *Entity) QueryFinancials() *FinancialQuery

QueryFinancials queries the "financials" edge of the Entity entity.

func (*Entity) QueryIntervals

func (e *Entity) QueryIntervals() *IntervalQuery

QueryIntervals queries the "intervals" edge of the Entity entity.

func (*Entity) QuerySplits

func (e *Entity) QuerySplits() *SplitQuery

QuerySplits queries the "splits" edge of the Entity entity.

func (*Entity) String

func (e *Entity) String() string

String implements the fmt.Stringer.

func (*Entity) Unwrap

func (e *Entity) Unwrap() *Entity

Unwrap unwraps the Entity 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 (*Entity) Update

func (e *Entity) Update() *EntityUpdateOne

Update returns a builder for updating this Entity. Note that you need to call Entity.Unwrap() before calling this method if this Entity was returned from a transaction, and the transaction was committed or rolled back.

type EntityClient

type EntityClient struct {
	// contains filtered or unexported fields
}

EntityClient is a client for the Entity schema.

func NewEntityClient

func NewEntityClient(c config) *EntityClient

NewEntityClient returns a client for the Entity from the given config.

func (*EntityClient) Create

func (c *EntityClient) Create() *EntityCreate

Create returns a builder for creating a Entity entity.

func (*EntityClient) CreateBulk

func (c *EntityClient) CreateBulk(builders ...*EntityCreate) *EntityCreateBulk

CreateBulk returns a builder for creating a bulk of Entity entities.

func (*EntityClient) Delete

func (c *EntityClient) Delete() *EntityDelete

Delete returns a delete builder for Entity.

func (*EntityClient) DeleteOne

func (c *EntityClient) DeleteOne(e *Entity) *EntityDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*EntityClient) DeleteOneID

func (c *EntityClient) DeleteOneID(id int) *EntityDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*EntityClient) Get

func (c *EntityClient) Get(ctx context.Context, id int) (*Entity, error)

Get returns a Entity entity by its id.

func (*EntityClient) GetX

func (c *EntityClient) GetX(ctx context.Context, id int) *Entity

GetX is like Get, but panics if an error occurs.

func (*EntityClient) Hooks

func (c *EntityClient) Hooks() []Hook

Hooks returns the client hooks.

func (*EntityClient) Intercept

func (c *EntityClient) Intercept(interceptors ...Interceptor)

Use adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `entity.Intercept(f(g(h())))`.

func (*EntityClient) Interceptors

func (c *EntityClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*EntityClient) Query

func (c *EntityClient) Query() *EntityQuery

Query returns a query builder for Entity.

func (*EntityClient) QueryDividends

func (c *EntityClient) QueryDividends(e *Entity) *DividendQuery

QueryDividends queries the dividends edge of a Entity.

func (*EntityClient) QueryExchanges

func (c *EntityClient) QueryExchanges(e *Entity) *ExchangeQuery

QueryExchanges queries the exchanges edge of a Entity.

func (*EntityClient) QueryFinancials

func (c *EntityClient) QueryFinancials(e *Entity) *FinancialQuery

QueryFinancials queries the financials edge of a Entity.

func (*EntityClient) QueryIntervals

func (c *EntityClient) QueryIntervals(e *Entity) *IntervalQuery

QueryIntervals queries the intervals edge of a Entity.

func (*EntityClient) QuerySplits

func (c *EntityClient) QuerySplits(e *Entity) *SplitQuery

QuerySplits queries the splits edge of a Entity.

func (*EntityClient) Update

func (c *EntityClient) Update() *EntityUpdate

Update returns an update builder for Entity.

func (*EntityClient) UpdateOne

func (c *EntityClient) UpdateOne(e *Entity) *EntityUpdateOne

UpdateOne returns an update builder for the given entity.

func (*EntityClient) UpdateOneID

func (c *EntityClient) UpdateOneID(id int) *EntityUpdateOne

UpdateOneID returns an update builder for the given id.

func (*EntityClient) Use

func (c *EntityClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `entity.Hooks(f(g(h())))`.

type EntityCreate

type EntityCreate struct {
	// contains filtered or unexported fields
}

EntityCreate is the builder for creating a Entity entity.

func (*EntityCreate) AddDividendIDs

func (ec *EntityCreate) AddDividendIDs(ids ...int) *EntityCreate

AddDividendIDs adds the "dividends" edge to the Dividend entity by IDs.

func (*EntityCreate) AddDividends

func (ec *EntityCreate) AddDividends(d ...*Dividend) *EntityCreate

AddDividends adds the "dividends" edges to the Dividend entity.

func (*EntityCreate) AddExchangeIDs

func (ec *EntityCreate) AddExchangeIDs(ids ...int) *EntityCreate

AddExchangeIDs adds the "exchanges" edge to the Exchange entity by IDs.

func (*EntityCreate) AddExchanges

func (ec *EntityCreate) AddExchanges(e ...*Exchange) *EntityCreate

AddExchanges adds the "exchanges" edges to the Exchange entity.

func (*EntityCreate) AddFinancialIDs

func (ec *EntityCreate) AddFinancialIDs(ids ...int) *EntityCreate

AddFinancialIDs adds the "financials" edge to the Financial entity by IDs.

func (*EntityCreate) AddFinancials

func (ec *EntityCreate) AddFinancials(f ...*Financial) *EntityCreate

AddFinancials adds the "financials" edges to the Financial entity.

func (*EntityCreate) AddIntervalIDs

func (ec *EntityCreate) AddIntervalIDs(ids ...int) *EntityCreate

AddIntervalIDs adds the "intervals" edge to the Interval entity by IDs.

func (*EntityCreate) AddIntervals

func (ec *EntityCreate) AddIntervals(i ...*Interval) *EntityCreate

AddIntervals adds the "intervals" edges to the Interval entity.

func (*EntityCreate) AddSplitIDs

func (ec *EntityCreate) AddSplitIDs(ids ...int) *EntityCreate

AddSplitIDs adds the "splits" edge to the Split entity by IDs.

func (*EntityCreate) AddSplits

func (ec *EntityCreate) AddSplits(s ...*Split) *EntityCreate

AddSplits adds the "splits" edges to the Split entity.

func (*EntityCreate) Exec

func (ec *EntityCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*EntityCreate) ExecX

func (ec *EntityCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EntityCreate) Mutation

func (ec *EntityCreate) Mutation() *EntityMutation

Mutation returns the EntityMutation object of the builder.

func (*EntityCreate) Save

func (ec *EntityCreate) Save(ctx context.Context) (*Entity, error)

Save creates the Entity in the database.

func (*EntityCreate) SaveX

func (ec *EntityCreate) SaveX(ctx context.Context) *Entity

SaveX calls Save and panics if Save returns an error.

func (*EntityCreate) SetActive

func (ec *EntityCreate) SetActive(b bool) *EntityCreate

SetActive sets the "active" field.

func (*EntityCreate) SetDelisted

func (ec *EntityCreate) SetDelisted(t time.Time) *EntityCreate

SetDelisted sets the "delisted" field.

func (*EntityCreate) SetDescription

func (ec *EntityCreate) SetDescription(s string) *EntityCreate

SetDescription sets the "description" field.

func (*EntityCreate) SetListDate

func (ec *EntityCreate) SetListDate(t time.Time) *EntityCreate

SetListDate sets the "list_date" field.

func (*EntityCreate) SetName

func (ec *EntityCreate) SetName(s string) *EntityCreate

SetName sets the "name" field.

func (*EntityCreate) SetNillableDelisted

func (ec *EntityCreate) SetNillableDelisted(t *time.Time) *EntityCreate

SetNillableDelisted sets the "delisted" field if the given value is not nil.

func (*EntityCreate) SetTicker

func (ec *EntityCreate) SetTicker(s string) *EntityCreate

SetTicker sets the "ticker" field.

type EntityCreateBulk

type EntityCreateBulk struct {
	// contains filtered or unexported fields
}

EntityCreateBulk is the builder for creating many Entity entities in bulk.

func (*EntityCreateBulk) Exec

func (ecb *EntityCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*EntityCreateBulk) ExecX

func (ecb *EntityCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EntityCreateBulk) Save

func (ecb *EntityCreateBulk) Save(ctx context.Context) ([]*Entity, error)

Save creates the Entity entities in the database.

func (*EntityCreateBulk) SaveX

func (ecb *EntityCreateBulk) SaveX(ctx context.Context) []*Entity

SaveX is like Save, but panics if an error occurs.

type EntityDelete

type EntityDelete struct {
	// contains filtered or unexported fields
}

EntityDelete is the builder for deleting a Entity entity.

func (*EntityDelete) Exec

func (ed *EntityDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*EntityDelete) ExecX

func (ed *EntityDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*EntityDelete) Where

func (ed *EntityDelete) Where(ps ...predicate.Entity) *EntityDelete

Where appends a list predicates to the EntityDelete builder.

type EntityDeleteOne

type EntityDeleteOne struct {
	// contains filtered or unexported fields
}

EntityDeleteOne is the builder for deleting a single Entity entity.

func (*EntityDeleteOne) Exec

func (edo *EntityDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*EntityDeleteOne) ExecX

func (edo *EntityDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type EntityEdges

type EntityEdges struct {
	// Exchanges holds the value of the exchanges edge.
	Exchanges []*Exchange `json:"exchanges,omitempty"`
	// Intervals holds the value of the intervals edge.
	Intervals []*Interval `json:"intervals,omitempty"`
	// Dividends holds the value of the dividends edge.
	Dividends []*Dividend `json:"dividends,omitempty"`
	// Splits holds the value of the splits edge.
	Splits []*Split `json:"splits,omitempty"`
	// Financials holds the value of the financials edge.
	Financials []*Financial `json:"financials,omitempty"`
	// contains filtered or unexported fields
}

EntityEdges holds the relations/edges for other nodes in the graph.

func (EntityEdges) DividendsOrErr

func (e EntityEdges) DividendsOrErr() ([]*Dividend, error)

DividendsOrErr returns the Dividends value or an error if the edge was not loaded in eager-loading.

func (EntityEdges) ExchangesOrErr

func (e EntityEdges) ExchangesOrErr() ([]*Exchange, error)

ExchangesOrErr returns the Exchanges value or an error if the edge was not loaded in eager-loading.

func (EntityEdges) FinancialsOrErr

func (e EntityEdges) FinancialsOrErr() ([]*Financial, error)

FinancialsOrErr returns the Financials value or an error if the edge was not loaded in eager-loading.

func (EntityEdges) IntervalsOrErr

func (e EntityEdges) IntervalsOrErr() ([]*Interval, error)

IntervalsOrErr returns the Intervals value or an error if the edge was not loaded in eager-loading.

func (EntityEdges) SplitsOrErr

func (e EntityEdges) SplitsOrErr() ([]*Split, error)

SplitsOrErr returns the Splits value or an error if the edge was not loaded in eager-loading.

type EntityGroupBy

type EntityGroupBy struct {
	// contains filtered or unexported fields
}

EntityGroupBy is the group-by builder for Entity entities.

func (*EntityGroupBy) Aggregate

func (egb *EntityGroupBy) Aggregate(fns ...AggregateFunc) *EntityGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*EntityGroupBy) Bool

func (s *EntityGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*EntityGroupBy) BoolX

func (s *EntityGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*EntityGroupBy) Bools

func (s *EntityGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*EntityGroupBy) BoolsX

func (s *EntityGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*EntityGroupBy) Float64

func (s *EntityGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*EntityGroupBy) Float64X

func (s *EntityGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*EntityGroupBy) Float64s

func (s *EntityGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*EntityGroupBy) Float64sX

func (s *EntityGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*EntityGroupBy) Int

func (s *EntityGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*EntityGroupBy) IntX

func (s *EntityGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*EntityGroupBy) Ints

func (s *EntityGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*EntityGroupBy) IntsX

func (s *EntityGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*EntityGroupBy) Scan

func (egb *EntityGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*EntityGroupBy) ScanX

func (s *EntityGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*EntityGroupBy) String

func (s *EntityGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*EntityGroupBy) StringX

func (s *EntityGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*EntityGroupBy) Strings

func (s *EntityGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*EntityGroupBy) StringsX

func (s *EntityGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type EntityMutation

type EntityMutation struct {
	// contains filtered or unexported fields
}

EntityMutation represents an operation that mutates the Entity nodes in the graph.

func (*EntityMutation) Active

func (m *EntityMutation) Active() (r bool, exists bool)

Active returns the value of the "active" field in the mutation.

func (*EntityMutation) AddDividendIDs

func (m *EntityMutation) AddDividendIDs(ids ...int)

AddDividendIDs adds the "dividends" edge to the Dividend entity by ids.

func (*EntityMutation) AddExchangeIDs

func (m *EntityMutation) AddExchangeIDs(ids ...int)

AddExchangeIDs adds the "exchanges" edge to the Exchange entity by ids.

func (*EntityMutation) AddField

func (m *EntityMutation) 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 (*EntityMutation) AddFinancialIDs

func (m *EntityMutation) AddFinancialIDs(ids ...int)

AddFinancialIDs adds the "financials" edge to the Financial entity by ids.

func (*EntityMutation) AddIntervalIDs

func (m *EntityMutation) AddIntervalIDs(ids ...int)

AddIntervalIDs adds the "intervals" edge to the Interval entity by ids.

func (*EntityMutation) AddSplitIDs

func (m *EntityMutation) AddSplitIDs(ids ...int)

AddSplitIDs adds the "splits" edge to the Split entity by ids.

func (*EntityMutation) AddedEdges

func (m *EntityMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*EntityMutation) AddedField

func (m *EntityMutation) 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 (*EntityMutation) AddedFields

func (m *EntityMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*EntityMutation) AddedIDs

func (m *EntityMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*EntityMutation) ClearDelisted

func (m *EntityMutation) ClearDelisted()

ClearDelisted clears the value of the "delisted" field.

func (*EntityMutation) ClearDividends

func (m *EntityMutation) ClearDividends()

ClearDividends clears the "dividends" edge to the Dividend entity.

func (*EntityMutation) ClearEdge

func (m *EntityMutation) 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 (*EntityMutation) ClearExchanges

func (m *EntityMutation) ClearExchanges()

ClearExchanges clears the "exchanges" edge to the Exchange entity.

func (*EntityMutation) ClearField

func (m *EntityMutation) 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 (*EntityMutation) ClearFinancials

func (m *EntityMutation) ClearFinancials()

ClearFinancials clears the "financials" edge to the Financial entity.

func (*EntityMutation) ClearIntervals

func (m *EntityMutation) ClearIntervals()

ClearIntervals clears the "intervals" edge to the Interval entity.

func (*EntityMutation) ClearSplits

func (m *EntityMutation) ClearSplits()

ClearSplits clears the "splits" edge to the Split entity.

func (*EntityMutation) ClearedEdges

func (m *EntityMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*EntityMutation) ClearedFields

func (m *EntityMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (EntityMutation) Client

func (m EntityMutation) 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 (*EntityMutation) Delisted

func (m *EntityMutation) Delisted() (r time.Time, exists bool)

Delisted returns the value of the "delisted" field in the mutation.

func (*EntityMutation) DelistedCleared

func (m *EntityMutation) DelistedCleared() bool

DelistedCleared returns if the "delisted" field was cleared in this mutation.

func (*EntityMutation) Description

func (m *EntityMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*EntityMutation) DividendsCleared

func (m *EntityMutation) DividendsCleared() bool

DividendsCleared reports if the "dividends" edge to the Dividend entity was cleared.

func (*EntityMutation) DividendsIDs

func (m *EntityMutation) DividendsIDs() (ids []int)

DividendsIDs returns the "dividends" edge IDs in the mutation.

func (*EntityMutation) EdgeCleared

func (m *EntityMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*EntityMutation) ExchangesCleared

func (m *EntityMutation) ExchangesCleared() bool

ExchangesCleared reports if the "exchanges" edge to the Exchange entity was cleared.

func (*EntityMutation) ExchangesIDs

func (m *EntityMutation) ExchangesIDs() (ids []int)

ExchangesIDs returns the "exchanges" edge IDs in the mutation.

func (*EntityMutation) Field

func (m *EntityMutation) 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 (*EntityMutation) FieldCleared

func (m *EntityMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*EntityMutation) Fields

func (m *EntityMutation) 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 (*EntityMutation) FinancialsCleared

func (m *EntityMutation) FinancialsCleared() bool

FinancialsCleared reports if the "financials" edge to the Financial entity was cleared.

func (*EntityMutation) FinancialsIDs

func (m *EntityMutation) FinancialsIDs() (ids []int)

FinancialsIDs returns the "financials" edge IDs in the mutation.

func (*EntityMutation) ID

func (m *EntityMutation) 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 (*EntityMutation) IDs

func (m *EntityMutation) 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 (*EntityMutation) IntervalsCleared

func (m *EntityMutation) IntervalsCleared() bool

IntervalsCleared reports if the "intervals" edge to the Interval entity was cleared.

func (*EntityMutation) IntervalsIDs

func (m *EntityMutation) IntervalsIDs() (ids []int)

IntervalsIDs returns the "intervals" edge IDs in the mutation.

func (*EntityMutation) ListDate

func (m *EntityMutation) ListDate() (r time.Time, exists bool)

ListDate returns the value of the "list_date" field in the mutation.

func (*EntityMutation) Name

func (m *EntityMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*EntityMutation) OldActive

func (m *EntityMutation) OldActive(ctx context.Context) (v bool, err error)

OldActive returns the old "active" field's value of the Entity entity. If the Entity 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 (*EntityMutation) OldDelisted

func (m *EntityMutation) OldDelisted(ctx context.Context) (v *time.Time, err error)

OldDelisted returns the old "delisted" field's value of the Entity entity. If the Entity 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 (*EntityMutation) OldDescription

func (m *EntityMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the Entity entity. If the Entity 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 (*EntityMutation) OldField

func (m *EntityMutation) 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 (*EntityMutation) OldListDate

func (m *EntityMutation) OldListDate(ctx context.Context) (v time.Time, err error)

OldListDate returns the old "list_date" field's value of the Entity entity. If the Entity 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 (*EntityMutation) OldName

func (m *EntityMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Entity entity. If the Entity 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 (*EntityMutation) OldTicker

func (m *EntityMutation) OldTicker(ctx context.Context) (v string, err error)

OldTicker returns the old "ticker" field's value of the Entity entity. If the Entity 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 (*EntityMutation) Op

func (m *EntityMutation) Op() Op

Op returns the operation name.

func (*EntityMutation) RemoveDividendIDs

func (m *EntityMutation) RemoveDividendIDs(ids ...int)

RemoveDividendIDs removes the "dividends" edge to the Dividend entity by IDs.

func (*EntityMutation) RemoveExchangeIDs

func (m *EntityMutation) RemoveExchangeIDs(ids ...int)

RemoveExchangeIDs removes the "exchanges" edge to the Exchange entity by IDs.

func (*EntityMutation) RemoveFinancialIDs

func (m *EntityMutation) RemoveFinancialIDs(ids ...int)

RemoveFinancialIDs removes the "financials" edge to the Financial entity by IDs.

func (*EntityMutation) RemoveIntervalIDs

func (m *EntityMutation) RemoveIntervalIDs(ids ...int)

RemoveIntervalIDs removes the "intervals" edge to the Interval entity by IDs.

func (*EntityMutation) RemoveSplitIDs

func (m *EntityMutation) RemoveSplitIDs(ids ...int)

RemoveSplitIDs removes the "splits" edge to the Split entity by IDs.

func (*EntityMutation) RemovedDividendsIDs

func (m *EntityMutation) RemovedDividendsIDs() (ids []int)

RemovedDividends returns the removed IDs of the "dividends" edge to the Dividend entity.

func (*EntityMutation) RemovedEdges

func (m *EntityMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*EntityMutation) RemovedExchangesIDs

func (m *EntityMutation) RemovedExchangesIDs() (ids []int)

RemovedExchanges returns the removed IDs of the "exchanges" edge to the Exchange entity.

func (*EntityMutation) RemovedFinancialsIDs

func (m *EntityMutation) RemovedFinancialsIDs() (ids []int)

RemovedFinancials returns the removed IDs of the "financials" edge to the Financial entity.

func (*EntityMutation) RemovedIDs

func (m *EntityMutation) 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 (*EntityMutation) RemovedIntervalsIDs

func (m *EntityMutation) RemovedIntervalsIDs() (ids []int)

RemovedIntervals returns the removed IDs of the "intervals" edge to the Interval entity.

func (*EntityMutation) RemovedSplitsIDs

func (m *EntityMutation) RemovedSplitsIDs() (ids []int)

RemovedSplits returns the removed IDs of the "splits" edge to the Split entity.

func (*EntityMutation) ResetActive

func (m *EntityMutation) ResetActive()

ResetActive resets all changes to the "active" field.

func (*EntityMutation) ResetDelisted

func (m *EntityMutation) ResetDelisted()

ResetDelisted resets all changes to the "delisted" field.

func (*EntityMutation) ResetDescription

func (m *EntityMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*EntityMutation) ResetDividends

func (m *EntityMutation) ResetDividends()

ResetDividends resets all changes to the "dividends" edge.

func (*EntityMutation) ResetEdge

func (m *EntityMutation) 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 (*EntityMutation) ResetExchanges

func (m *EntityMutation) ResetExchanges()

ResetExchanges resets all changes to the "exchanges" edge.

func (*EntityMutation) ResetField

func (m *EntityMutation) 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 (*EntityMutation) ResetFinancials

func (m *EntityMutation) ResetFinancials()

ResetFinancials resets all changes to the "financials" edge.

func (*EntityMutation) ResetIntervals

func (m *EntityMutation) ResetIntervals()

ResetIntervals resets all changes to the "intervals" edge.

func (*EntityMutation) ResetListDate

func (m *EntityMutation) ResetListDate()

ResetListDate resets all changes to the "list_date" field.

func (*EntityMutation) ResetName

func (m *EntityMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*EntityMutation) ResetSplits

func (m *EntityMutation) ResetSplits()

ResetSplits resets all changes to the "splits" edge.

func (*EntityMutation) ResetTicker

func (m *EntityMutation) ResetTicker()

ResetTicker resets all changes to the "ticker" field.

func (*EntityMutation) SetActive

func (m *EntityMutation) SetActive(b bool)

SetActive sets the "active" field.

func (*EntityMutation) SetDelisted

func (m *EntityMutation) SetDelisted(t time.Time)

SetDelisted sets the "delisted" field.

func (*EntityMutation) SetDescription

func (m *EntityMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*EntityMutation) SetField

func (m *EntityMutation) 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 (*EntityMutation) SetListDate

func (m *EntityMutation) SetListDate(t time.Time)

SetListDate sets the "list_date" field.

func (*EntityMutation) SetName

func (m *EntityMutation) SetName(s string)

SetName sets the "name" field.

func (*EntityMutation) SetOp

func (m *EntityMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*EntityMutation) SetTicker

func (m *EntityMutation) SetTicker(s string)

SetTicker sets the "ticker" field.

func (*EntityMutation) SplitsCleared

func (m *EntityMutation) SplitsCleared() bool

SplitsCleared reports if the "splits" edge to the Split entity was cleared.

func (*EntityMutation) SplitsIDs

func (m *EntityMutation) SplitsIDs() (ids []int)

SplitsIDs returns the "splits" edge IDs in the mutation.

func (*EntityMutation) Ticker

func (m *EntityMutation) Ticker() (r string, exists bool)

Ticker returns the value of the "ticker" field in the mutation.

func (EntityMutation) Tx

func (m EntityMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*EntityMutation) Type

func (m *EntityMutation) Type() string

Type returns the node type of this mutation (Entity).

func (*EntityMutation) Where

func (m *EntityMutation) Where(ps ...predicate.Entity)

Where appends a list predicates to the EntityMutation builder.

func (*EntityMutation) WhereP

func (m *EntityMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the EntityMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type EntityQuery

type EntityQuery struct {
	// contains filtered or unexported fields
}

EntityQuery is the builder for querying Entity entities.

func (*EntityQuery) Aggregate

func (eq *EntityQuery) Aggregate(fns ...AggregateFunc) *EntitySelect

Aggregate returns a EntitySelect configured with the given aggregations.

func (*EntityQuery) All

func (eq *EntityQuery) All(ctx context.Context) ([]*Entity, error)

All executes the query and returns a list of Entities.

func (*EntityQuery) AllX

func (eq *EntityQuery) AllX(ctx context.Context) []*Entity

AllX is like All, but panics if an error occurs.

func (*EntityQuery) Clone

func (eq *EntityQuery) Clone() *EntityQuery

Clone returns a duplicate of the EntityQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*EntityQuery) Count

func (eq *EntityQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*EntityQuery) CountX

func (eq *EntityQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*EntityQuery) Exist

func (eq *EntityQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*EntityQuery) ExistX

func (eq *EntityQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*EntityQuery) First

func (eq *EntityQuery) First(ctx context.Context) (*Entity, error)

First returns the first Entity entity from the query. Returns a *NotFoundError when no Entity was found.

func (*EntityQuery) FirstID

func (eq *EntityQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Entity ID from the query. Returns a *NotFoundError when no Entity ID was found.

func (*EntityQuery) FirstIDX

func (eq *EntityQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*EntityQuery) FirstX

func (eq *EntityQuery) FirstX(ctx context.Context) *Entity

FirstX is like First, but panics if an error occurs.

func (*EntityQuery) GroupBy

func (eq *EntityQuery) GroupBy(field string, fields ...string) *EntityGroupBy

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 {
	Active bool `json:"active,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Entity.Query().
	GroupBy(entity.FieldActive).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*EntityQuery) IDs

func (eq *EntityQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of Entity IDs.

func (*EntityQuery) IDsX

func (eq *EntityQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*EntityQuery) Limit

func (eq *EntityQuery) Limit(limit int) *EntityQuery

Limit the number of records to be returned by this query.

func (*EntityQuery) Offset

func (eq *EntityQuery) Offset(offset int) *EntityQuery

Offset to start from.

func (*EntityQuery) Only

func (eq *EntityQuery) Only(ctx context.Context) (*Entity, error)

Only returns a single Entity entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Entity entity is found. Returns a *NotFoundError when no Entity entities are found.

func (*EntityQuery) OnlyID

func (eq *EntityQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Entity ID in the query. Returns a *NotSingularError when more than one Entity ID is found. Returns a *NotFoundError when no entities are found.

func (*EntityQuery) OnlyIDX

func (eq *EntityQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*EntityQuery) OnlyX

func (eq *EntityQuery) OnlyX(ctx context.Context) *Entity

OnlyX is like Only, but panics if an error occurs.

func (*EntityQuery) Order

func (eq *EntityQuery) Order(o ...OrderFunc) *EntityQuery

Order specifies how the records should be ordered.

func (*EntityQuery) QueryDividends

func (eq *EntityQuery) QueryDividends() *DividendQuery

QueryDividends chains the current query on the "dividends" edge.

func (*EntityQuery) QueryExchanges

func (eq *EntityQuery) QueryExchanges() *ExchangeQuery

QueryExchanges chains the current query on the "exchanges" edge.

func (*EntityQuery) QueryFinancials

func (eq *EntityQuery) QueryFinancials() *FinancialQuery

QueryFinancials chains the current query on the "financials" edge.

func (*EntityQuery) QueryIntervals

func (eq *EntityQuery) QueryIntervals() *IntervalQuery

QueryIntervals chains the current query on the "intervals" edge.

func (*EntityQuery) QuerySplits

func (eq *EntityQuery) QuerySplits() *SplitQuery

QuerySplits chains the current query on the "splits" edge.

func (*EntityQuery) Select

func (eq *EntityQuery) Select(fields ...string) *EntitySelect

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 {
	Active bool `json:"active,omitempty"`
}

client.Entity.Query().
	Select(entity.FieldActive).
	Scan(ctx, &v)

func (*EntityQuery) Unique

func (eq *EntityQuery) Unique(unique bool) *EntityQuery

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 (*EntityQuery) Where

func (eq *EntityQuery) Where(ps ...predicate.Entity) *EntityQuery

Where adds a new predicate for the EntityQuery builder.

func (*EntityQuery) WithDividends

func (eq *EntityQuery) WithDividends(opts ...func(*DividendQuery)) *EntityQuery

WithDividends tells the query-builder to eager-load the nodes that are connected to the "dividends" edge. The optional arguments are used to configure the query builder of the edge.

func (*EntityQuery) WithExchanges

func (eq *EntityQuery) WithExchanges(opts ...func(*ExchangeQuery)) *EntityQuery

WithExchanges tells the query-builder to eager-load the nodes that are connected to the "exchanges" edge. The optional arguments are used to configure the query builder of the edge.

func (*EntityQuery) WithFinancials

func (eq *EntityQuery) WithFinancials(opts ...func(*FinancialQuery)) *EntityQuery

WithFinancials tells the query-builder to eager-load the nodes that are connected to the "financials" edge. The optional arguments are used to configure the query builder of the edge.

func (*EntityQuery) WithIntervals

func (eq *EntityQuery) WithIntervals(opts ...func(*IntervalQuery)) *EntityQuery

WithIntervals tells the query-builder to eager-load the nodes that are connected to the "intervals" edge. The optional arguments are used to configure the query builder of the edge.

func (*EntityQuery) WithSplits

func (eq *EntityQuery) WithSplits(opts ...func(*SplitQuery)) *EntityQuery

WithSplits tells the query-builder to eager-load the nodes that are connected to the "splits" edge. The optional arguments are used to configure the query builder of the edge.

type EntitySelect

type EntitySelect struct {
	*EntityQuery
	// contains filtered or unexported fields
}

EntitySelect is the builder for selecting fields of Entity entities.

func (*EntitySelect) Aggregate

func (es *EntitySelect) Aggregate(fns ...AggregateFunc) *EntitySelect

Aggregate adds the given aggregation functions to the selector query.

func (*EntitySelect) Bool

func (s *EntitySelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*EntitySelect) BoolX

func (s *EntitySelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*EntitySelect) Bools

func (s *EntitySelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*EntitySelect) BoolsX

func (s *EntitySelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*EntitySelect) Float64

func (s *EntitySelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*EntitySelect) Float64X

func (s *EntitySelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*EntitySelect) Float64s

func (s *EntitySelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*EntitySelect) Float64sX

func (s *EntitySelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*EntitySelect) Int

func (s *EntitySelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*EntitySelect) IntX

func (s *EntitySelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*EntitySelect) Ints

func (s *EntitySelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*EntitySelect) IntsX

func (s *EntitySelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*EntitySelect) Scan

func (es *EntitySelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*EntitySelect) ScanX

func (s *EntitySelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*EntitySelect) String

func (s *EntitySelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*EntitySelect) StringX

func (s *EntitySelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*EntitySelect) Strings

func (s *EntitySelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*EntitySelect) StringsX

func (s *EntitySelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type EntityUpdate

type EntityUpdate struct {
	// contains filtered or unexported fields
}

EntityUpdate is the builder for updating Entity entities.

func (*EntityUpdate) AddDividendIDs

func (eu *EntityUpdate) AddDividendIDs(ids ...int) *EntityUpdate

AddDividendIDs adds the "dividends" edge to the Dividend entity by IDs.

func (*EntityUpdate) AddDividends

func (eu *EntityUpdate) AddDividends(d ...*Dividend) *EntityUpdate

AddDividends adds the "dividends" edges to the Dividend entity.

func (*EntityUpdate) AddExchangeIDs

func (eu *EntityUpdate) AddExchangeIDs(ids ...int) *EntityUpdate

AddExchangeIDs adds the "exchanges" edge to the Exchange entity by IDs.

func (*EntityUpdate) AddExchanges

func (eu *EntityUpdate) AddExchanges(e ...*Exchange) *EntityUpdate

AddExchanges adds the "exchanges" edges to the Exchange entity.

func (*EntityUpdate) AddFinancialIDs

func (eu *EntityUpdate) AddFinancialIDs(ids ...int) *EntityUpdate

AddFinancialIDs adds the "financials" edge to the Financial entity by IDs.

func (*EntityUpdate) AddFinancials

func (eu *EntityUpdate) AddFinancials(f ...*Financial) *EntityUpdate

AddFinancials adds the "financials" edges to the Financial entity.

func (*EntityUpdate) AddIntervalIDs

func (eu *EntityUpdate) AddIntervalIDs(ids ...int) *EntityUpdate

AddIntervalIDs adds the "intervals" edge to the Interval entity by IDs.

func (*EntityUpdate) AddIntervals

func (eu *EntityUpdate) AddIntervals(i ...*Interval) *EntityUpdate

AddIntervals adds the "intervals" edges to the Interval entity.

func (*EntityUpdate) AddSplitIDs

func (eu *EntityUpdate) AddSplitIDs(ids ...int) *EntityUpdate

AddSplitIDs adds the "splits" edge to the Split entity by IDs.

func (*EntityUpdate) AddSplits

func (eu *EntityUpdate) AddSplits(s ...*Split) *EntityUpdate

AddSplits adds the "splits" edges to the Split entity.

func (*EntityUpdate) ClearDelisted

func (eu *EntityUpdate) ClearDelisted() *EntityUpdate

ClearDelisted clears the value of the "delisted" field.

func (*EntityUpdate) ClearDividends

func (eu *EntityUpdate) ClearDividends() *EntityUpdate

ClearDividends clears all "dividends" edges to the Dividend entity.

func (*EntityUpdate) ClearExchanges

func (eu *EntityUpdate) ClearExchanges() *EntityUpdate

ClearExchanges clears all "exchanges" edges to the Exchange entity.

func (*EntityUpdate) ClearFinancials

func (eu *EntityUpdate) ClearFinancials() *EntityUpdate

ClearFinancials clears all "financials" edges to the Financial entity.

func (*EntityUpdate) ClearIntervals

func (eu *EntityUpdate) ClearIntervals() *EntityUpdate

ClearIntervals clears all "intervals" edges to the Interval entity.

func (*EntityUpdate) ClearSplits

func (eu *EntityUpdate) ClearSplits() *EntityUpdate

ClearSplits clears all "splits" edges to the Split entity.

func (*EntityUpdate) Exec

func (eu *EntityUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*EntityUpdate) ExecX

func (eu *EntityUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EntityUpdate) Mutation

func (eu *EntityUpdate) Mutation() *EntityMutation

Mutation returns the EntityMutation object of the builder.

func (*EntityUpdate) RemoveDividendIDs

func (eu *EntityUpdate) RemoveDividendIDs(ids ...int) *EntityUpdate

RemoveDividendIDs removes the "dividends" edge to Dividend entities by IDs.

func (*EntityUpdate) RemoveDividends

func (eu *EntityUpdate) RemoveDividends(d ...*Dividend) *EntityUpdate

RemoveDividends removes "dividends" edges to Dividend entities.

func (*EntityUpdate) RemoveExchangeIDs

func (eu *EntityUpdate) RemoveExchangeIDs(ids ...int) *EntityUpdate

RemoveExchangeIDs removes the "exchanges" edge to Exchange entities by IDs.

func (*EntityUpdate) RemoveExchanges

func (eu *EntityUpdate) RemoveExchanges(e ...*Exchange) *EntityUpdate

RemoveExchanges removes "exchanges" edges to Exchange entities.

func (*EntityUpdate) RemoveFinancialIDs

func (eu *EntityUpdate) RemoveFinancialIDs(ids ...int) *EntityUpdate

RemoveFinancialIDs removes the "financials" edge to Financial entities by IDs.

func (*EntityUpdate) RemoveFinancials

func (eu *EntityUpdate) RemoveFinancials(f ...*Financial) *EntityUpdate

RemoveFinancials removes "financials" edges to Financial entities.

func (*EntityUpdate) RemoveIntervalIDs

func (eu *EntityUpdate) RemoveIntervalIDs(ids ...int) *EntityUpdate

RemoveIntervalIDs removes the "intervals" edge to Interval entities by IDs.

func (*EntityUpdate) RemoveIntervals

func (eu *EntityUpdate) RemoveIntervals(i ...*Interval) *EntityUpdate

RemoveIntervals removes "intervals" edges to Interval entities.

func (*EntityUpdate) RemoveSplitIDs

func (eu *EntityUpdate) RemoveSplitIDs(ids ...int) *EntityUpdate

RemoveSplitIDs removes the "splits" edge to Split entities by IDs.

func (*EntityUpdate) RemoveSplits

func (eu *EntityUpdate) RemoveSplits(s ...*Split) *EntityUpdate

RemoveSplits removes "splits" edges to Split entities.

func (*EntityUpdate) Save

func (eu *EntityUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*EntityUpdate) SaveX

func (eu *EntityUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*EntityUpdate) SetActive

func (eu *EntityUpdate) SetActive(b bool) *EntityUpdate

SetActive sets the "active" field.

func (*EntityUpdate) SetDelisted

func (eu *EntityUpdate) SetDelisted(t time.Time) *EntityUpdate

SetDelisted sets the "delisted" field.

func (*EntityUpdate) SetDescription

func (eu *EntityUpdate) SetDescription(s string) *EntityUpdate

SetDescription sets the "description" field.

func (*EntityUpdate) SetListDate

func (eu *EntityUpdate) SetListDate(t time.Time) *EntityUpdate

SetListDate sets the "list_date" field.

func (*EntityUpdate) SetName

func (eu *EntityUpdate) SetName(s string) *EntityUpdate

SetName sets the "name" field.

func (*EntityUpdate) SetNillableDelisted

func (eu *EntityUpdate) SetNillableDelisted(t *time.Time) *EntityUpdate

SetNillableDelisted sets the "delisted" field if the given value is not nil.

func (*EntityUpdate) SetTicker

func (eu *EntityUpdate) SetTicker(s string) *EntityUpdate

SetTicker sets the "ticker" field.

func (*EntityUpdate) Where

func (eu *EntityUpdate) Where(ps ...predicate.Entity) *EntityUpdate

Where appends a list predicates to the EntityUpdate builder.

type EntityUpdateOne

type EntityUpdateOne struct {
	// contains filtered or unexported fields
}

EntityUpdateOne is the builder for updating a single Entity entity.

func (*EntityUpdateOne) AddDividendIDs

func (euo *EntityUpdateOne) AddDividendIDs(ids ...int) *EntityUpdateOne

AddDividendIDs adds the "dividends" edge to the Dividend entity by IDs.

func (*EntityUpdateOne) AddDividends

func (euo *EntityUpdateOne) AddDividends(d ...*Dividend) *EntityUpdateOne

AddDividends adds the "dividends" edges to the Dividend entity.

func (*EntityUpdateOne) AddExchangeIDs

func (euo *EntityUpdateOne) AddExchangeIDs(ids ...int) *EntityUpdateOne

AddExchangeIDs adds the "exchanges" edge to the Exchange entity by IDs.

func (*EntityUpdateOne) AddExchanges

func (euo *EntityUpdateOne) AddExchanges(e ...*Exchange) *EntityUpdateOne

AddExchanges adds the "exchanges" edges to the Exchange entity.

func (*EntityUpdateOne) AddFinancialIDs

func (euo *EntityUpdateOne) AddFinancialIDs(ids ...int) *EntityUpdateOne

AddFinancialIDs adds the "financials" edge to the Financial entity by IDs.

func (*EntityUpdateOne) AddFinancials

func (euo *EntityUpdateOne) AddFinancials(f ...*Financial) *EntityUpdateOne

AddFinancials adds the "financials" edges to the Financial entity.

func (*EntityUpdateOne) AddIntervalIDs

func (euo *EntityUpdateOne) AddIntervalIDs(ids ...int) *EntityUpdateOne

AddIntervalIDs adds the "intervals" edge to the Interval entity by IDs.

func (*EntityUpdateOne) AddIntervals

func (euo *EntityUpdateOne) AddIntervals(i ...*Interval) *EntityUpdateOne

AddIntervals adds the "intervals" edges to the Interval entity.

func (*EntityUpdateOne) AddSplitIDs

func (euo *EntityUpdateOne) AddSplitIDs(ids ...int) *EntityUpdateOne

AddSplitIDs adds the "splits" edge to the Split entity by IDs.

func (*EntityUpdateOne) AddSplits

func (euo *EntityUpdateOne) AddSplits(s ...*Split) *EntityUpdateOne

AddSplits adds the "splits" edges to the Split entity.

func (*EntityUpdateOne) ClearDelisted

func (euo *EntityUpdateOne) ClearDelisted() *EntityUpdateOne

ClearDelisted clears the value of the "delisted" field.

func (*EntityUpdateOne) ClearDividends

func (euo *EntityUpdateOne) ClearDividends() *EntityUpdateOne

ClearDividends clears all "dividends" edges to the Dividend entity.

func (*EntityUpdateOne) ClearExchanges

func (euo *EntityUpdateOne) ClearExchanges() *EntityUpdateOne

ClearExchanges clears all "exchanges" edges to the Exchange entity.

func (*EntityUpdateOne) ClearFinancials

func (euo *EntityUpdateOne) ClearFinancials() *EntityUpdateOne

ClearFinancials clears all "financials" edges to the Financial entity.

func (*EntityUpdateOne) ClearIntervals

func (euo *EntityUpdateOne) ClearIntervals() *EntityUpdateOne

ClearIntervals clears all "intervals" edges to the Interval entity.

func (*EntityUpdateOne) ClearSplits

func (euo *EntityUpdateOne) ClearSplits() *EntityUpdateOne

ClearSplits clears all "splits" edges to the Split entity.

func (*EntityUpdateOne) Exec

func (euo *EntityUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*EntityUpdateOne) ExecX

func (euo *EntityUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EntityUpdateOne) Mutation

func (euo *EntityUpdateOne) Mutation() *EntityMutation

Mutation returns the EntityMutation object of the builder.

func (*EntityUpdateOne) RemoveDividendIDs

func (euo *EntityUpdateOne) RemoveDividendIDs(ids ...int) *EntityUpdateOne

RemoveDividendIDs removes the "dividends" edge to Dividend entities by IDs.

func (*EntityUpdateOne) RemoveDividends

func (euo *EntityUpdateOne) RemoveDividends(d ...*Dividend) *EntityUpdateOne

RemoveDividends removes "dividends" edges to Dividend entities.

func (*EntityUpdateOne) RemoveExchangeIDs

func (euo *EntityUpdateOne) RemoveExchangeIDs(ids ...int) *EntityUpdateOne

RemoveExchangeIDs removes the "exchanges" edge to Exchange entities by IDs.

func (*EntityUpdateOne) RemoveExchanges

func (euo *EntityUpdateOne) RemoveExchanges(e ...*Exchange) *EntityUpdateOne

RemoveExchanges removes "exchanges" edges to Exchange entities.

func (*EntityUpdateOne) RemoveFinancialIDs

func (euo *EntityUpdateOne) RemoveFinancialIDs(ids ...int) *EntityUpdateOne

RemoveFinancialIDs removes the "financials" edge to Financial entities by IDs.

func (*EntityUpdateOne) RemoveFinancials

func (euo *EntityUpdateOne) RemoveFinancials(f ...*Financial) *EntityUpdateOne

RemoveFinancials removes "financials" edges to Financial entities.

func (*EntityUpdateOne) RemoveIntervalIDs

func (euo *EntityUpdateOne) RemoveIntervalIDs(ids ...int) *EntityUpdateOne

RemoveIntervalIDs removes the "intervals" edge to Interval entities by IDs.

func (*EntityUpdateOne) RemoveIntervals

func (euo *EntityUpdateOne) RemoveIntervals(i ...*Interval) *EntityUpdateOne

RemoveIntervals removes "intervals" edges to Interval entities.

func (*EntityUpdateOne) RemoveSplitIDs

func (euo *EntityUpdateOne) RemoveSplitIDs(ids ...int) *EntityUpdateOne

RemoveSplitIDs removes the "splits" edge to Split entities by IDs.

func (*EntityUpdateOne) RemoveSplits

func (euo *EntityUpdateOne) RemoveSplits(s ...*Split) *EntityUpdateOne

RemoveSplits removes "splits" edges to Split entities.

func (*EntityUpdateOne) Save

func (euo *EntityUpdateOne) Save(ctx context.Context) (*Entity, error)

Save executes the query and returns the updated Entity entity.

func (*EntityUpdateOne) SaveX

func (euo *EntityUpdateOne) SaveX(ctx context.Context) *Entity

SaveX is like Save, but panics if an error occurs.

func (*EntityUpdateOne) Select

func (euo *EntityUpdateOne) Select(field string, fields ...string) *EntityUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*EntityUpdateOne) SetActive

func (euo *EntityUpdateOne) SetActive(b bool) *EntityUpdateOne

SetActive sets the "active" field.

func (*EntityUpdateOne) SetDelisted

func (euo *EntityUpdateOne) SetDelisted(t time.Time) *EntityUpdateOne

SetDelisted sets the "delisted" field.

func (*EntityUpdateOne) SetDescription

func (euo *EntityUpdateOne) SetDescription(s string) *EntityUpdateOne

SetDescription sets the "description" field.

func (*EntityUpdateOne) SetListDate

func (euo *EntityUpdateOne) SetListDate(t time.Time) *EntityUpdateOne

SetListDate sets the "list_date" field.

func (*EntityUpdateOne) SetName

func (euo *EntityUpdateOne) SetName(s string) *EntityUpdateOne

SetName sets the "name" field.

func (*EntityUpdateOne) SetNillableDelisted

func (euo *EntityUpdateOne) SetNillableDelisted(t *time.Time) *EntityUpdateOne

SetNillableDelisted sets the "delisted" field if the given value is not nil.

func (*EntityUpdateOne) SetTicker

func (euo *EntityUpdateOne) SetTicker(s string) *EntityUpdateOne

SetTicker sets the "ticker" field.

type Exchange

type Exchange struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Code holds the value of the "code" field.
	Code string `json:"code,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ExchangeQuery when eager-loading is set.
	Edges ExchangeEdges `json:"edges"`
	// contains filtered or unexported fields
}

Exchange is the model entity for the Exchange schema.

func (*Exchange) QueryStocks

func (e *Exchange) QueryStocks() *EntityQuery

QueryStocks queries the "stocks" edge of the Exchange entity.

func (*Exchange) String

func (e *Exchange) String() string

String implements the fmt.Stringer.

func (*Exchange) Unwrap

func (e *Exchange) Unwrap() *Exchange

Unwrap unwraps the Exchange 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 (*Exchange) Update

func (e *Exchange) Update() *ExchangeUpdateOne

Update returns a builder for updating this Exchange. Note that you need to call Exchange.Unwrap() before calling this method if this Exchange was returned from a transaction, and the transaction was committed or rolled back.

type ExchangeClient

type ExchangeClient struct {
	// contains filtered or unexported fields
}

ExchangeClient is a client for the Exchange schema.

func NewExchangeClient

func NewExchangeClient(c config) *ExchangeClient

NewExchangeClient returns a client for the Exchange from the given config.

func (*ExchangeClient) Create

func (c *ExchangeClient) Create() *ExchangeCreate

Create returns a builder for creating a Exchange entity.

func (*ExchangeClient) CreateBulk

func (c *ExchangeClient) CreateBulk(builders ...*ExchangeCreate) *ExchangeCreateBulk

CreateBulk returns a builder for creating a bulk of Exchange entities.

func (*ExchangeClient) Delete

func (c *ExchangeClient) Delete() *ExchangeDelete

Delete returns a delete builder for Exchange.

func (*ExchangeClient) DeleteOne

func (c *ExchangeClient) DeleteOne(e *Exchange) *ExchangeDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ExchangeClient) DeleteOneID

func (c *ExchangeClient) DeleteOneID(id int) *ExchangeDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*ExchangeClient) Get

func (c *ExchangeClient) Get(ctx context.Context, id int) (*Exchange, error)

Get returns a Exchange entity by its id.

func (*ExchangeClient) GetX

func (c *ExchangeClient) GetX(ctx context.Context, id int) *Exchange

GetX is like Get, but panics if an error occurs.

func (*ExchangeClient) Hooks

func (c *ExchangeClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ExchangeClient) Intercept

func (c *ExchangeClient) Intercept(interceptors ...Interceptor)

Use adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `exchange.Intercept(f(g(h())))`.

func (*ExchangeClient) Interceptors

func (c *ExchangeClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*ExchangeClient) Query

func (c *ExchangeClient) Query() *ExchangeQuery

Query returns a query builder for Exchange.

func (*ExchangeClient) QueryStocks

func (c *ExchangeClient) QueryStocks(e *Exchange) *EntityQuery

QueryStocks queries the stocks edge of a Exchange.

func (*ExchangeClient) Update

func (c *ExchangeClient) Update() *ExchangeUpdate

Update returns an update builder for Exchange.

func (*ExchangeClient) UpdateOne

func (c *ExchangeClient) UpdateOne(e *Exchange) *ExchangeUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ExchangeClient) UpdateOneID

func (c *ExchangeClient) UpdateOneID(id int) *ExchangeUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ExchangeClient) Use

func (c *ExchangeClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `exchange.Hooks(f(g(h())))`.

type ExchangeCreate

type ExchangeCreate struct {
	// contains filtered or unexported fields
}

ExchangeCreate is the builder for creating a Exchange entity.

func (*ExchangeCreate) AddStockIDs

func (ec *ExchangeCreate) AddStockIDs(ids ...int) *ExchangeCreate

AddStockIDs adds the "stocks" edge to the Entity entity by IDs.

func (*ExchangeCreate) AddStocks

func (ec *ExchangeCreate) AddStocks(e ...*Entity) *ExchangeCreate

AddStocks adds the "stocks" edges to the Entity entity.

func (*ExchangeCreate) Exec

func (ec *ExchangeCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ExchangeCreate) ExecX

func (ec *ExchangeCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ExchangeCreate) Mutation

func (ec *ExchangeCreate) Mutation() *ExchangeMutation

Mutation returns the ExchangeMutation object of the builder.

func (*ExchangeCreate) Save

func (ec *ExchangeCreate) Save(ctx context.Context) (*Exchange, error)

Save creates the Exchange in the database.

func (*ExchangeCreate) SaveX

func (ec *ExchangeCreate) SaveX(ctx context.Context) *Exchange

SaveX calls Save and panics if Save returns an error.

func (*ExchangeCreate) SetCode

func (ec *ExchangeCreate) SetCode(s string) *ExchangeCreate

SetCode sets the "code" field.

func (*ExchangeCreate) SetName

func (ec *ExchangeCreate) SetName(s string) *ExchangeCreate

SetName sets the "name" field.

type ExchangeCreateBulk

type ExchangeCreateBulk struct {
	// contains filtered or unexported fields
}

ExchangeCreateBulk is the builder for creating many Exchange entities in bulk.

func (*ExchangeCreateBulk) Exec

func (ecb *ExchangeCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ExchangeCreateBulk) ExecX

func (ecb *ExchangeCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ExchangeCreateBulk) Save

func (ecb *ExchangeCreateBulk) Save(ctx context.Context) ([]*Exchange, error)

Save creates the Exchange entities in the database.

func (*ExchangeCreateBulk) SaveX

func (ecb *ExchangeCreateBulk) SaveX(ctx context.Context) []*Exchange

SaveX is like Save, but panics if an error occurs.

type ExchangeDelete

type ExchangeDelete struct {
	// contains filtered or unexported fields
}

ExchangeDelete is the builder for deleting a Exchange entity.

func (*ExchangeDelete) Exec

func (ed *ExchangeDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ExchangeDelete) ExecX

func (ed *ExchangeDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ExchangeDelete) Where

func (ed *ExchangeDelete) Where(ps ...predicate.Exchange) *ExchangeDelete

Where appends a list predicates to the ExchangeDelete builder.

type ExchangeDeleteOne

type ExchangeDeleteOne struct {
	// contains filtered or unexported fields
}

ExchangeDeleteOne is the builder for deleting a single Exchange entity.

func (*ExchangeDeleteOne) Exec

func (edo *ExchangeDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ExchangeDeleteOne) ExecX

func (edo *ExchangeDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type ExchangeEdges

type ExchangeEdges struct {
	// Stocks holds the value of the stocks edge.
	Stocks []*Entity `json:"stocks,omitempty"`
	// contains filtered or unexported fields
}

ExchangeEdges holds the relations/edges for other nodes in the graph.

func (ExchangeEdges) StocksOrErr

func (e ExchangeEdges) StocksOrErr() ([]*Entity, error)

StocksOrErr returns the Stocks value or an error if the edge was not loaded in eager-loading.

type ExchangeGroupBy

type ExchangeGroupBy struct {
	// contains filtered or unexported fields
}

ExchangeGroupBy is the group-by builder for Exchange entities.

func (*ExchangeGroupBy) Aggregate

func (egb *ExchangeGroupBy) Aggregate(fns ...AggregateFunc) *ExchangeGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ExchangeGroupBy) Bool

func (s *ExchangeGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ExchangeGroupBy) BoolX

func (s *ExchangeGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ExchangeGroupBy) Bools

func (s *ExchangeGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ExchangeGroupBy) BoolsX

func (s *ExchangeGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ExchangeGroupBy) Float64

func (s *ExchangeGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ExchangeGroupBy) Float64X

func (s *ExchangeGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ExchangeGroupBy) Float64s

func (s *ExchangeGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ExchangeGroupBy) Float64sX

func (s *ExchangeGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ExchangeGroupBy) Int

func (s *ExchangeGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ExchangeGroupBy) IntX

func (s *ExchangeGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ExchangeGroupBy) Ints

func (s *ExchangeGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ExchangeGroupBy) IntsX

func (s *ExchangeGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ExchangeGroupBy) Scan

func (egb *ExchangeGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ExchangeGroupBy) ScanX

func (s *ExchangeGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ExchangeGroupBy) String

func (s *ExchangeGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ExchangeGroupBy) StringX

func (s *ExchangeGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ExchangeGroupBy) Strings

func (s *ExchangeGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ExchangeGroupBy) StringsX

func (s *ExchangeGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ExchangeMutation

type ExchangeMutation struct {
	// contains filtered or unexported fields
}

ExchangeMutation represents an operation that mutates the Exchange nodes in the graph.

func (*ExchangeMutation) AddField

func (m *ExchangeMutation) 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 (*ExchangeMutation) AddStockIDs

func (m *ExchangeMutation) AddStockIDs(ids ...int)

AddStockIDs adds the "stocks" edge to the Entity entity by ids.

func (*ExchangeMutation) AddedEdges

func (m *ExchangeMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ExchangeMutation) AddedField

func (m *ExchangeMutation) 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 (*ExchangeMutation) AddedFields

func (m *ExchangeMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ExchangeMutation) AddedIDs

func (m *ExchangeMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ExchangeMutation) ClearEdge

func (m *ExchangeMutation) 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 (*ExchangeMutation) ClearField

func (m *ExchangeMutation) 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 (*ExchangeMutation) ClearStocks

func (m *ExchangeMutation) ClearStocks()

ClearStocks clears the "stocks" edge to the Entity entity.

func (*ExchangeMutation) ClearedEdges

func (m *ExchangeMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ExchangeMutation) ClearedFields

func (m *ExchangeMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ExchangeMutation) Client

func (m ExchangeMutation) 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 (*ExchangeMutation) Code

func (m *ExchangeMutation) Code() (r string, exists bool)

Code returns the value of the "code" field in the mutation.

func (*ExchangeMutation) EdgeCleared

func (m *ExchangeMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ExchangeMutation) Field

func (m *ExchangeMutation) 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 (*ExchangeMutation) FieldCleared

func (m *ExchangeMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ExchangeMutation) Fields

func (m *ExchangeMutation) 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 (*ExchangeMutation) ID

func (m *ExchangeMutation) 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 (*ExchangeMutation) IDs

func (m *ExchangeMutation) 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 (*ExchangeMutation) Name

func (m *ExchangeMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*ExchangeMutation) OldCode

func (m *ExchangeMutation) OldCode(ctx context.Context) (v string, err error)

OldCode returns the old "code" field's value of the Exchange entity. If the Exchange 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 (*ExchangeMutation) OldField

func (m *ExchangeMutation) 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 (*ExchangeMutation) OldName

func (m *ExchangeMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Exchange entity. If the Exchange 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 (*ExchangeMutation) Op

func (m *ExchangeMutation) Op() Op

Op returns the operation name.

func (*ExchangeMutation) RemoveStockIDs

func (m *ExchangeMutation) RemoveStockIDs(ids ...int)

RemoveStockIDs removes the "stocks" edge to the Entity entity by IDs.

func (*ExchangeMutation) RemovedEdges

func (m *ExchangeMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ExchangeMutation) RemovedIDs

func (m *ExchangeMutation) 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 (*ExchangeMutation) RemovedStocksIDs

func (m *ExchangeMutation) RemovedStocksIDs() (ids []int)

RemovedStocks returns the removed IDs of the "stocks" edge to the Entity entity.

func (*ExchangeMutation) ResetCode

func (m *ExchangeMutation) ResetCode()

ResetCode resets all changes to the "code" field.

func (*ExchangeMutation) ResetEdge

func (m *ExchangeMutation) 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 (*ExchangeMutation) ResetField

func (m *ExchangeMutation) 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 (*ExchangeMutation) ResetName

func (m *ExchangeMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ExchangeMutation) ResetStocks

func (m *ExchangeMutation) ResetStocks()

ResetStocks resets all changes to the "stocks" edge.

func (*ExchangeMutation) SetCode

func (m *ExchangeMutation) SetCode(s string)

SetCode sets the "code" field.

func (*ExchangeMutation) SetField

func (m *ExchangeMutation) 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 (*ExchangeMutation) SetName

func (m *ExchangeMutation) SetName(s string)

SetName sets the "name" field.

func (*ExchangeMutation) SetOp

func (m *ExchangeMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ExchangeMutation) StocksCleared

func (m *ExchangeMutation) StocksCleared() bool

StocksCleared reports if the "stocks" edge to the Entity entity was cleared.

func (*ExchangeMutation) StocksIDs

func (m *ExchangeMutation) StocksIDs() (ids []int)

StocksIDs returns the "stocks" edge IDs in the mutation.

func (ExchangeMutation) Tx

func (m ExchangeMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ExchangeMutation) Type

func (m *ExchangeMutation) Type() string

Type returns the node type of this mutation (Exchange).

func (*ExchangeMutation) Where

func (m *ExchangeMutation) Where(ps ...predicate.Exchange)

Where appends a list predicates to the ExchangeMutation builder.

func (*ExchangeMutation) WhereP

func (m *ExchangeMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the ExchangeMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type ExchangeQuery

type ExchangeQuery struct {
	// contains filtered or unexported fields
}

ExchangeQuery is the builder for querying Exchange entities.

func (*ExchangeQuery) Aggregate

func (eq *ExchangeQuery) Aggregate(fns ...AggregateFunc) *ExchangeSelect

Aggregate returns a ExchangeSelect configured with the given aggregations.

func (*ExchangeQuery) All

func (eq *ExchangeQuery) All(ctx context.Context) ([]*Exchange, error)

All executes the query and returns a list of Exchanges.

func (*ExchangeQuery) AllX

func (eq *ExchangeQuery) AllX(ctx context.Context) []*Exchange

AllX is like All, but panics if an error occurs.

func (*ExchangeQuery) Clone

func (eq *ExchangeQuery) Clone() *ExchangeQuery

Clone returns a duplicate of the ExchangeQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ExchangeQuery) Count

func (eq *ExchangeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ExchangeQuery) CountX

func (eq *ExchangeQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ExchangeQuery) Exist

func (eq *ExchangeQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ExchangeQuery) ExistX

func (eq *ExchangeQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ExchangeQuery) First

func (eq *ExchangeQuery) First(ctx context.Context) (*Exchange, error)

First returns the first Exchange entity from the query. Returns a *NotFoundError when no Exchange was found.

func (*ExchangeQuery) FirstID

func (eq *ExchangeQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Exchange ID from the query. Returns a *NotFoundError when no Exchange ID was found.

func (*ExchangeQuery) FirstIDX

func (eq *ExchangeQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*ExchangeQuery) FirstX

func (eq *ExchangeQuery) FirstX(ctx context.Context) *Exchange

FirstX is like First, but panics if an error occurs.

func (*ExchangeQuery) GroupBy

func (eq *ExchangeQuery) GroupBy(field string, fields ...string) *ExchangeGroupBy

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 {
	Code string `json:"code,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Exchange.Query().
	GroupBy(exchange.FieldCode).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ExchangeQuery) IDs

func (eq *ExchangeQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of Exchange IDs.

func (*ExchangeQuery) IDsX

func (eq *ExchangeQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*ExchangeQuery) Limit

func (eq *ExchangeQuery) Limit(limit int) *ExchangeQuery

Limit the number of records to be returned by this query.

func (*ExchangeQuery) Offset

func (eq *ExchangeQuery) Offset(offset int) *ExchangeQuery

Offset to start from.

func (*ExchangeQuery) Only

func (eq *ExchangeQuery) Only(ctx context.Context) (*Exchange, error)

Only returns a single Exchange entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Exchange entity is found. Returns a *NotFoundError when no Exchange entities are found.

func (*ExchangeQuery) OnlyID

func (eq *ExchangeQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Exchange ID in the query. Returns a *NotSingularError when more than one Exchange ID is found. Returns a *NotFoundError when no entities are found.

func (*ExchangeQuery) OnlyIDX

func (eq *ExchangeQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ExchangeQuery) OnlyX

func (eq *ExchangeQuery) OnlyX(ctx context.Context) *Exchange

OnlyX is like Only, but panics if an error occurs.

func (*ExchangeQuery) Order

func (eq *ExchangeQuery) Order(o ...OrderFunc) *ExchangeQuery

Order specifies how the records should be ordered.

func (*ExchangeQuery) QueryStocks

func (eq *ExchangeQuery) QueryStocks() *EntityQuery

QueryStocks chains the current query on the "stocks" edge.

func (*ExchangeQuery) Select

func (eq *ExchangeQuery) Select(fields ...string) *ExchangeSelect

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 {
	Code string `json:"code,omitempty"`
}

client.Exchange.Query().
	Select(exchange.FieldCode).
	Scan(ctx, &v)

func (*ExchangeQuery) Unique

func (eq *ExchangeQuery) Unique(unique bool) *ExchangeQuery

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 (*ExchangeQuery) Where

func (eq *ExchangeQuery) Where(ps ...predicate.Exchange) *ExchangeQuery

Where adds a new predicate for the ExchangeQuery builder.

func (*ExchangeQuery) WithStocks

func (eq *ExchangeQuery) WithStocks(opts ...func(*EntityQuery)) *ExchangeQuery

WithStocks tells the query-builder to eager-load the nodes that are connected to the "stocks" edge. The optional arguments are used to configure the query builder of the edge.

type ExchangeSelect

type ExchangeSelect struct {
	*ExchangeQuery
	// contains filtered or unexported fields
}

ExchangeSelect is the builder for selecting fields of Exchange entities.

func (*ExchangeSelect) Aggregate

func (es *ExchangeSelect) Aggregate(fns ...AggregateFunc) *ExchangeSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ExchangeSelect) Bool

func (s *ExchangeSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ExchangeSelect) BoolX

func (s *ExchangeSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ExchangeSelect) Bools

func (s *ExchangeSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ExchangeSelect) BoolsX

func (s *ExchangeSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ExchangeSelect) Float64

func (s *ExchangeSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ExchangeSelect) Float64X

func (s *ExchangeSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ExchangeSelect) Float64s

func (s *ExchangeSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ExchangeSelect) Float64sX

func (s *ExchangeSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ExchangeSelect) Int

func (s *ExchangeSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ExchangeSelect) IntX

func (s *ExchangeSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ExchangeSelect) Ints

func (s *ExchangeSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ExchangeSelect) IntsX

func (s *ExchangeSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ExchangeSelect) Scan

func (es *ExchangeSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*ExchangeSelect) ScanX

func (s *ExchangeSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*ExchangeSelect) String

func (s *ExchangeSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ExchangeSelect) StringX

func (s *ExchangeSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ExchangeSelect) Strings

func (s *ExchangeSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ExchangeSelect) StringsX

func (s *ExchangeSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ExchangeUpdate

type ExchangeUpdate struct {
	// contains filtered or unexported fields
}

ExchangeUpdate is the builder for updating Exchange entities.

func (*ExchangeUpdate) AddStockIDs

func (eu *ExchangeUpdate) AddStockIDs(ids ...int) *ExchangeUpdate

AddStockIDs adds the "stocks" edge to the Entity entity by IDs.

func (*ExchangeUpdate) AddStocks

func (eu *ExchangeUpdate) AddStocks(e ...*Entity) *ExchangeUpdate

AddStocks adds the "stocks" edges to the Entity entity.

func (*ExchangeUpdate) ClearStocks

func (eu *ExchangeUpdate) ClearStocks() *ExchangeUpdate

ClearStocks clears all "stocks" edges to the Entity entity.

func (*ExchangeUpdate) Exec

func (eu *ExchangeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ExchangeUpdate) ExecX

func (eu *ExchangeUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ExchangeUpdate) Mutation

func (eu *ExchangeUpdate) Mutation() *ExchangeMutation

Mutation returns the ExchangeMutation object of the builder.

func (*ExchangeUpdate) RemoveStockIDs

func (eu *ExchangeUpdate) RemoveStockIDs(ids ...int) *ExchangeUpdate

RemoveStockIDs removes the "stocks" edge to Entity entities by IDs.

func (*ExchangeUpdate) RemoveStocks

func (eu *ExchangeUpdate) RemoveStocks(e ...*Entity) *ExchangeUpdate

RemoveStocks removes "stocks" edges to Entity entities.

func (*ExchangeUpdate) Save

func (eu *ExchangeUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ExchangeUpdate) SaveX

func (eu *ExchangeUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ExchangeUpdate) SetCode

func (eu *ExchangeUpdate) SetCode(s string) *ExchangeUpdate

SetCode sets the "code" field.

func (*ExchangeUpdate) SetName

func (eu *ExchangeUpdate) SetName(s string) *ExchangeUpdate

SetName sets the "name" field.

func (*ExchangeUpdate) Where

func (eu *ExchangeUpdate) Where(ps ...predicate.Exchange) *ExchangeUpdate

Where appends a list predicates to the ExchangeUpdate builder.

type ExchangeUpdateOne

type ExchangeUpdateOne struct {
	// contains filtered or unexported fields
}

ExchangeUpdateOne is the builder for updating a single Exchange entity.

func (*ExchangeUpdateOne) AddStockIDs

func (euo *ExchangeUpdateOne) AddStockIDs(ids ...int) *ExchangeUpdateOne

AddStockIDs adds the "stocks" edge to the Entity entity by IDs.

func (*ExchangeUpdateOne) AddStocks

func (euo *ExchangeUpdateOne) AddStocks(e ...*Entity) *ExchangeUpdateOne

AddStocks adds the "stocks" edges to the Entity entity.

func (*ExchangeUpdateOne) ClearStocks

func (euo *ExchangeUpdateOne) ClearStocks() *ExchangeUpdateOne

ClearStocks clears all "stocks" edges to the Entity entity.

func (*ExchangeUpdateOne) Exec

func (euo *ExchangeUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ExchangeUpdateOne) ExecX

func (euo *ExchangeUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ExchangeUpdateOne) Mutation

func (euo *ExchangeUpdateOne) Mutation() *ExchangeMutation

Mutation returns the ExchangeMutation object of the builder.

func (*ExchangeUpdateOne) RemoveStockIDs

func (euo *ExchangeUpdateOne) RemoveStockIDs(ids ...int) *ExchangeUpdateOne

RemoveStockIDs removes the "stocks" edge to Entity entities by IDs.

func (*ExchangeUpdateOne) RemoveStocks

func (euo *ExchangeUpdateOne) RemoveStocks(e ...*Entity) *ExchangeUpdateOne

RemoveStocks removes "stocks" edges to Entity entities.

func (*ExchangeUpdateOne) Save

func (euo *ExchangeUpdateOne) Save(ctx context.Context) (*Exchange, error)

Save executes the query and returns the updated Exchange entity.

func (*ExchangeUpdateOne) SaveX

func (euo *ExchangeUpdateOne) SaveX(ctx context.Context) *Exchange

SaveX is like Save, but panics if an error occurs.

func (*ExchangeUpdateOne) Select

func (euo *ExchangeUpdateOne) Select(field string, fields ...string) *ExchangeUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ExchangeUpdateOne) SetCode

func (euo *ExchangeUpdateOne) SetCode(s string) *ExchangeUpdateOne

SetCode sets the "code" field.

func (*ExchangeUpdateOne) SetName

func (euo *ExchangeUpdateOne) SetName(s string) *ExchangeUpdateOne

SetName sets the "name" field.

type Exchanges

type Exchanges []*Exchange

Exchanges is a parsable slice of Exchange.

type Financial

type Financial struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the FinancialQuery when eager-loading is set.
	Edges FinancialEdges `json:"edges"`
	// contains filtered or unexported fields
}

Financial is the model entity for the Financial schema.

func (*Financial) QueryStock

func (f *Financial) QueryStock() *EntityQuery

QueryStock queries the "stock" edge of the Financial entity.

func (*Financial) String

func (f *Financial) String() string

String implements the fmt.Stringer.

func (*Financial) Unwrap

func (f *Financial) Unwrap() *Financial

Unwrap unwraps the Financial 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 (*Financial) Update

func (f *Financial) Update() *FinancialUpdateOne

Update returns a builder for updating this Financial. Note that you need to call Financial.Unwrap() before calling this method if this Financial was returned from a transaction, and the transaction was committed or rolled back.

type FinancialClient

type FinancialClient struct {
	// contains filtered or unexported fields
}

FinancialClient is a client for the Financial schema.

func NewFinancialClient

func NewFinancialClient(c config) *FinancialClient

NewFinancialClient returns a client for the Financial from the given config.

func (*FinancialClient) Create

func (c *FinancialClient) Create() *FinancialCreate

Create returns a builder for creating a Financial entity.

func (*FinancialClient) CreateBulk

func (c *FinancialClient) CreateBulk(builders ...*FinancialCreate) *FinancialCreateBulk

CreateBulk returns a builder for creating a bulk of Financial entities.

func (*FinancialClient) Delete

func (c *FinancialClient) Delete() *FinancialDelete

Delete returns a delete builder for Financial.

func (*FinancialClient) DeleteOne

func (c *FinancialClient) DeleteOne(f *Financial) *FinancialDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*FinancialClient) DeleteOneID

func (c *FinancialClient) DeleteOneID(id int) *FinancialDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*FinancialClient) Get

func (c *FinancialClient) Get(ctx context.Context, id int) (*Financial, error)

Get returns a Financial entity by its id.

func (*FinancialClient) GetX

func (c *FinancialClient) GetX(ctx context.Context, id int) *Financial

GetX is like Get, but panics if an error occurs.

func (*FinancialClient) Hooks

func (c *FinancialClient) Hooks() []Hook

Hooks returns the client hooks.

func (*FinancialClient) Intercept

func (c *FinancialClient) Intercept(interceptors ...Interceptor)

Use adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `financial.Intercept(f(g(h())))`.

func (*FinancialClient) Interceptors

func (c *FinancialClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*FinancialClient) Query

func (c *FinancialClient) Query() *FinancialQuery

Query returns a query builder for Financial.

func (*FinancialClient) QueryStock

func (c *FinancialClient) QueryStock(f *Financial) *EntityQuery

QueryStock queries the stock edge of a Financial.

func (*FinancialClient) Update

func (c *FinancialClient) Update() *FinancialUpdate

Update returns an update builder for Financial.

func (*FinancialClient) UpdateOne

func (c *FinancialClient) UpdateOne(f *Financial) *FinancialUpdateOne

UpdateOne returns an update builder for the given entity.

func (*FinancialClient) UpdateOneID

func (c *FinancialClient) UpdateOneID(id int) *FinancialUpdateOne

UpdateOneID returns an update builder for the given id.

func (*FinancialClient) Use

func (c *FinancialClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `financial.Hooks(f(g(h())))`.

type FinancialCreate

type FinancialCreate struct {
	// contains filtered or unexported fields
}

FinancialCreate is the builder for creating a Financial entity.

func (*FinancialCreate) AddStock

func (fc *FinancialCreate) AddStock(e ...*Entity) *FinancialCreate

AddStock adds the "stock" edges to the Entity entity.

func (*FinancialCreate) AddStockIDs

func (fc *FinancialCreate) AddStockIDs(ids ...int) *FinancialCreate

AddStockIDs adds the "stock" edge to the Entity entity by IDs.

func (*FinancialCreate) Exec

func (fc *FinancialCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*FinancialCreate) ExecX

func (fc *FinancialCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*FinancialCreate) Mutation

func (fc *FinancialCreate) Mutation() *FinancialMutation

Mutation returns the FinancialMutation object of the builder.

func (*FinancialCreate) Save

func (fc *FinancialCreate) Save(ctx context.Context) (*Financial, error)

Save creates the Financial in the database.

func (*FinancialCreate) SaveX

func (fc *FinancialCreate) SaveX(ctx context.Context) *Financial

SaveX calls Save and panics if Save returns an error.

type FinancialCreateBulk

type FinancialCreateBulk struct {
	// contains filtered or unexported fields
}

FinancialCreateBulk is the builder for creating many Financial entities in bulk.

func (*FinancialCreateBulk) Exec

func (fcb *FinancialCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*FinancialCreateBulk) ExecX

func (fcb *FinancialCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*FinancialCreateBulk) Save

func (fcb *FinancialCreateBulk) Save(ctx context.Context) ([]*Financial, error)

Save creates the Financial entities in the database.

func (*FinancialCreateBulk) SaveX

func (fcb *FinancialCreateBulk) SaveX(ctx context.Context) []*Financial

SaveX is like Save, but panics if an error occurs.

type FinancialDelete

type FinancialDelete struct {
	// contains filtered or unexported fields
}

FinancialDelete is the builder for deleting a Financial entity.

func (*FinancialDelete) Exec

func (fd *FinancialDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*FinancialDelete) ExecX

func (fd *FinancialDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*FinancialDelete) Where

Where appends a list predicates to the FinancialDelete builder.

type FinancialDeleteOne

type FinancialDeleteOne struct {
	// contains filtered or unexported fields
}

FinancialDeleteOne is the builder for deleting a single Financial entity.

func (*FinancialDeleteOne) Exec

func (fdo *FinancialDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*FinancialDeleteOne) ExecX

func (fdo *FinancialDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type FinancialEdges

type FinancialEdges struct {
	// Stock holds the value of the stock edge.
	Stock []*Entity `json:"stock,omitempty"`
	// contains filtered or unexported fields
}

FinancialEdges holds the relations/edges for other nodes in the graph.

func (FinancialEdges) StockOrErr

func (e FinancialEdges) StockOrErr() ([]*Entity, error)

StockOrErr returns the Stock value or an error if the edge was not loaded in eager-loading.

type FinancialGroupBy

type FinancialGroupBy struct {
	// contains filtered or unexported fields
}

FinancialGroupBy is the group-by builder for Financial entities.

func (*FinancialGroupBy) Aggregate

func (fgb *FinancialGroupBy) Aggregate(fns ...AggregateFunc) *FinancialGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*FinancialGroupBy) Bool

func (s *FinancialGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*FinancialGroupBy) BoolX

func (s *FinancialGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*FinancialGroupBy) Bools

func (s *FinancialGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*FinancialGroupBy) BoolsX

func (s *FinancialGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*FinancialGroupBy) Float64

func (s *FinancialGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*FinancialGroupBy) Float64X

func (s *FinancialGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*FinancialGroupBy) Float64s

func (s *FinancialGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*FinancialGroupBy) Float64sX

func (s *FinancialGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*FinancialGroupBy) Int

func (s *FinancialGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*FinancialGroupBy) IntX

func (s *FinancialGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*FinancialGroupBy) Ints

func (s *FinancialGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*FinancialGroupBy) IntsX

func (s *FinancialGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*FinancialGroupBy) Scan

func (fgb *FinancialGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*FinancialGroupBy) ScanX

func (s *FinancialGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*FinancialGroupBy) String

func (s *FinancialGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*FinancialGroupBy) StringX

func (s *FinancialGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*FinancialGroupBy) Strings

func (s *FinancialGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*FinancialGroupBy) StringsX

func (s *FinancialGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type FinancialMutation

type FinancialMutation struct {
	// contains filtered or unexported fields
}

FinancialMutation represents an operation that mutates the Financial nodes in the graph.

func (*FinancialMutation) AddField

func (m *FinancialMutation) 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 (*FinancialMutation) AddStockIDs

func (m *FinancialMutation) AddStockIDs(ids ...int)

AddStockIDs adds the "stock" edge to the Entity entity by ids.

func (*FinancialMutation) AddedEdges

func (m *FinancialMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*FinancialMutation) AddedField

func (m *FinancialMutation) 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 (*FinancialMutation) AddedFields

func (m *FinancialMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*FinancialMutation) AddedIDs

func (m *FinancialMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*FinancialMutation) ClearEdge

func (m *FinancialMutation) 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 (*FinancialMutation) ClearField

func (m *FinancialMutation) 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 (*FinancialMutation) ClearStock

func (m *FinancialMutation) ClearStock()

ClearStock clears the "stock" edge to the Entity entity.

func (*FinancialMutation) ClearedEdges

func (m *FinancialMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*FinancialMutation) ClearedFields

func (m *FinancialMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (FinancialMutation) Client

func (m FinancialMutation) 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 (*FinancialMutation) EdgeCleared

func (m *FinancialMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*FinancialMutation) Field

func (m *FinancialMutation) 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 (*FinancialMutation) FieldCleared

func (m *FinancialMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*FinancialMutation) Fields

func (m *FinancialMutation) 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 (*FinancialMutation) ID

func (m *FinancialMutation) 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 (*FinancialMutation) IDs

func (m *FinancialMutation) 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 (*FinancialMutation) OldField

func (m *FinancialMutation) 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 (*FinancialMutation) Op

func (m *FinancialMutation) Op() Op

Op returns the operation name.

func (*FinancialMutation) RemoveStockIDs

func (m *FinancialMutation) RemoveStockIDs(ids ...int)

RemoveStockIDs removes the "stock" edge to the Entity entity by IDs.

func (*FinancialMutation) RemovedEdges

func (m *FinancialMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*FinancialMutation) RemovedIDs

func (m *FinancialMutation) 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 (*FinancialMutation) RemovedStockIDs

func (m *FinancialMutation) RemovedStockIDs() (ids []int)

RemovedStock returns the removed IDs of the "stock" edge to the Entity entity.

func (*FinancialMutation) ResetEdge

func (m *FinancialMutation) 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 (*FinancialMutation) ResetField

func (m *FinancialMutation) 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 (*FinancialMutation) ResetStock

func (m *FinancialMutation) ResetStock()

ResetStock resets all changes to the "stock" edge.

func (*FinancialMutation) SetField

func (m *FinancialMutation) 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 (*FinancialMutation) SetOp

func (m *FinancialMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*FinancialMutation) StockCleared

func (m *FinancialMutation) StockCleared() bool

StockCleared reports if the "stock" edge to the Entity entity was cleared.

func (*FinancialMutation) StockIDs

func (m *FinancialMutation) StockIDs() (ids []int)

StockIDs returns the "stock" edge IDs in the mutation.

func (FinancialMutation) Tx

func (m FinancialMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*FinancialMutation) Type

func (m *FinancialMutation) Type() string

Type returns the node type of this mutation (Financial).

func (*FinancialMutation) Where

func (m *FinancialMutation) Where(ps ...predicate.Financial)

Where appends a list predicates to the FinancialMutation builder.

func (*FinancialMutation) WhereP

func (m *FinancialMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the FinancialMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type FinancialQuery

type FinancialQuery struct {
	// contains filtered or unexported fields
}

FinancialQuery is the builder for querying Financial entities.

func (*FinancialQuery) Aggregate

func (fq *FinancialQuery) Aggregate(fns ...AggregateFunc) *FinancialSelect

Aggregate returns a FinancialSelect configured with the given aggregations.

func (*FinancialQuery) All

func (fq *FinancialQuery) All(ctx context.Context) ([]*Financial, error)

All executes the query and returns a list of Financials.

func (*FinancialQuery) AllX

func (fq *FinancialQuery) AllX(ctx context.Context) []*Financial

AllX is like All, but panics if an error occurs.

func (*FinancialQuery) Clone

func (fq *FinancialQuery) Clone() *FinancialQuery

Clone returns a duplicate of the FinancialQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*FinancialQuery) Count

func (fq *FinancialQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*FinancialQuery) CountX

func (fq *FinancialQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*FinancialQuery) Exist

func (fq *FinancialQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*FinancialQuery) ExistX

func (fq *FinancialQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*FinancialQuery) First

func (fq *FinancialQuery) First(ctx context.Context) (*Financial, error)

First returns the first Financial entity from the query. Returns a *NotFoundError when no Financial was found.

func (*FinancialQuery) FirstID

func (fq *FinancialQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Financial ID from the query. Returns a *NotFoundError when no Financial ID was found.

func (*FinancialQuery) FirstIDX

func (fq *FinancialQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*FinancialQuery) FirstX

func (fq *FinancialQuery) FirstX(ctx context.Context) *Financial

FirstX is like First, but panics if an error occurs.

func (*FinancialQuery) GroupBy

func (fq *FinancialQuery) GroupBy(field string, fields ...string) *FinancialGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

func (*FinancialQuery) IDs

func (fq *FinancialQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of Financial IDs.

func (*FinancialQuery) IDsX

func (fq *FinancialQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*FinancialQuery) Limit

func (fq *FinancialQuery) Limit(limit int) *FinancialQuery

Limit the number of records to be returned by this query.

func (*FinancialQuery) Offset

func (fq *FinancialQuery) Offset(offset int) *FinancialQuery

Offset to start from.

func (*FinancialQuery) Only

func (fq *FinancialQuery) Only(ctx context.Context) (*Financial, error)

Only returns a single Financial entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Financial entity is found. Returns a *NotFoundError when no Financial entities are found.

func (*FinancialQuery) OnlyID

func (fq *FinancialQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Financial ID in the query. Returns a *NotSingularError when more than one Financial ID is found. Returns a *NotFoundError when no entities are found.

func (*FinancialQuery) OnlyIDX

func (fq *FinancialQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*FinancialQuery) OnlyX

func (fq *FinancialQuery) OnlyX(ctx context.Context) *Financial

OnlyX is like Only, but panics if an error occurs.

func (*FinancialQuery) Order

func (fq *FinancialQuery) Order(o ...OrderFunc) *FinancialQuery

Order specifies how the records should be ordered.

func (*FinancialQuery) QueryStock

func (fq *FinancialQuery) QueryStock() *EntityQuery

QueryStock chains the current query on the "stock" edge.

func (*FinancialQuery) Select

func (fq *FinancialQuery) Select(fields ...string) *FinancialSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

func (*FinancialQuery) Unique

func (fq *FinancialQuery) Unique(unique bool) *FinancialQuery

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 (*FinancialQuery) Where

Where adds a new predicate for the FinancialQuery builder.

func (*FinancialQuery) WithStock

func (fq *FinancialQuery) WithStock(opts ...func(*EntityQuery)) *FinancialQuery

WithStock tells the query-builder to eager-load the nodes that are connected to the "stock" edge. The optional arguments are used to configure the query builder of the edge.

type FinancialSelect

type FinancialSelect struct {
	*FinancialQuery
	// contains filtered or unexported fields
}

FinancialSelect is the builder for selecting fields of Financial entities.

func (*FinancialSelect) Aggregate

func (fs *FinancialSelect) Aggregate(fns ...AggregateFunc) *FinancialSelect

Aggregate adds the given aggregation functions to the selector query.

func (*FinancialSelect) Bool

func (s *FinancialSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*FinancialSelect) BoolX

func (s *FinancialSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*FinancialSelect) Bools

func (s *FinancialSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*FinancialSelect) BoolsX

func (s *FinancialSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*FinancialSelect) Float64

func (s *FinancialSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*FinancialSelect) Float64X

func (s *FinancialSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*FinancialSelect) Float64s

func (s *FinancialSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*FinancialSelect) Float64sX

func (s *FinancialSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*FinancialSelect) Int

func (s *FinancialSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*FinancialSelect) IntX

func (s *FinancialSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*FinancialSelect) Ints

func (s *FinancialSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*FinancialSelect) IntsX

func (s *FinancialSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*FinancialSelect) Scan

func (fs *FinancialSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*FinancialSelect) ScanX

func (s *FinancialSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*FinancialSelect) String

func (s *FinancialSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*FinancialSelect) StringX

func (s *FinancialSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*FinancialSelect) Strings

func (s *FinancialSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*FinancialSelect) StringsX

func (s *FinancialSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type FinancialUpdate

type FinancialUpdate struct {
	// contains filtered or unexported fields
}

FinancialUpdate is the builder for updating Financial entities.

func (*FinancialUpdate) AddStock

func (fu *FinancialUpdate) AddStock(e ...*Entity) *FinancialUpdate

AddStock adds the "stock" edges to the Entity entity.

func (*FinancialUpdate) AddStockIDs

func (fu *FinancialUpdate) AddStockIDs(ids ...int) *FinancialUpdate

AddStockIDs adds the "stock" edge to the Entity entity by IDs.

func (*FinancialUpdate) ClearStock

func (fu *FinancialUpdate) ClearStock() *FinancialUpdate

ClearStock clears all "stock" edges to the Entity entity.

func (*FinancialUpdate) Exec

func (fu *FinancialUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*FinancialUpdate) ExecX

func (fu *FinancialUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*FinancialUpdate) Mutation

func (fu *FinancialUpdate) Mutation() *FinancialMutation

Mutation returns the FinancialMutation object of the builder.

func (*FinancialUpdate) RemoveStock

func (fu *FinancialUpdate) RemoveStock(e ...*Entity) *FinancialUpdate

RemoveStock removes "stock" edges to Entity entities.

func (*FinancialUpdate) RemoveStockIDs

func (fu *FinancialUpdate) RemoveStockIDs(ids ...int) *FinancialUpdate

RemoveStockIDs removes the "stock" edge to Entity entities by IDs.

func (*FinancialUpdate) Save

func (fu *FinancialUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*FinancialUpdate) SaveX

func (fu *FinancialUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*FinancialUpdate) Where

Where appends a list predicates to the FinancialUpdate builder.

type FinancialUpdateOne

type FinancialUpdateOne struct {
	// contains filtered or unexported fields
}

FinancialUpdateOne is the builder for updating a single Financial entity.

func (*FinancialUpdateOne) AddStock

func (fuo *FinancialUpdateOne) AddStock(e ...*Entity) *FinancialUpdateOne

AddStock adds the "stock" edges to the Entity entity.

func (*FinancialUpdateOne) AddStockIDs

func (fuo *FinancialUpdateOne) AddStockIDs(ids ...int) *FinancialUpdateOne

AddStockIDs adds the "stock" edge to the Entity entity by IDs.

func (*FinancialUpdateOne) ClearStock

func (fuo *FinancialUpdateOne) ClearStock() *FinancialUpdateOne

ClearStock clears all "stock" edges to the Entity entity.

func (*FinancialUpdateOne) Exec

func (fuo *FinancialUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*FinancialUpdateOne) ExecX

func (fuo *FinancialUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*FinancialUpdateOne) Mutation

func (fuo *FinancialUpdateOne) Mutation() *FinancialMutation

Mutation returns the FinancialMutation object of the builder.

func (*FinancialUpdateOne) RemoveStock

func (fuo *FinancialUpdateOne) RemoveStock(e ...*Entity) *FinancialUpdateOne

RemoveStock removes "stock" edges to Entity entities.

func (*FinancialUpdateOne) RemoveStockIDs

func (fuo *FinancialUpdateOne) RemoveStockIDs(ids ...int) *FinancialUpdateOne

RemoveStockIDs removes the "stock" edge to Entity entities by IDs.

func (*FinancialUpdateOne) Save

func (fuo *FinancialUpdateOne) Save(ctx context.Context) (*Financial, error)

Save executes the query and returns the updated Financial entity.

func (*FinancialUpdateOne) SaveX

func (fuo *FinancialUpdateOne) SaveX(ctx context.Context) *Financial

SaveX is like Save, but panics if an error occurs.

func (*FinancialUpdateOne) Select

func (fuo *FinancialUpdateOne) Select(field string, fields ...string) *FinancialUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

type Financials

type Financials []*Financial

Financials is a parsable slice of Financial.

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 Interval

type Interval struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Active holds the value of the "active" field.
	Active bool `json:"active,omitempty"`
	// Interval holds the value of the "interval" field.
	Interval interval.Interval `json:"interval,omitempty"`
	// StockID holds the value of the "stock_id" field.
	StockID int `json:"stock_id,omitempty"`
	// DataSourceID holds the value of the "data_source_id" field.
	DataSourceID int `json:"data_source_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the IntervalQuery when eager-loading is set.
	Edges IntervalEdges `json:"edges"`
	// contains filtered or unexported fields
}

Interval is the model entity for the Interval schema.

func (*Interval) QueryBars

func (i *Interval) QueryBars() *BarTimeRangeQuery

QueryBars queries the "bars" edge of the Interval entity.

func (*Interval) QueryDataSource

func (i *Interval) QueryDataSource() *DataSourceQuery

QueryDataSource queries the "data_source" edge of the Interval entity.

func (*Interval) QueryStock

func (i *Interval) QueryStock() *EntityQuery

QueryStock queries the "stock" edge of the Interval entity.

func (*Interval) QueryTrades

func (i *Interval) QueryTrades() *TradeTimeRangeQuery

QueryTrades queries the "trades" edge of the Interval entity.

func (*Interval) String

func (i *Interval) String() string

String implements the fmt.Stringer.

func (*Interval) Unwrap

func (i *Interval) Unwrap() *Interval

Unwrap unwraps the Interval 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 (*Interval) Update

func (i *Interval) Update() *IntervalUpdateOne

Update returns a builder for updating this Interval. Note that you need to call Interval.Unwrap() before calling this method if this Interval was returned from a transaction, and the transaction was committed or rolled back.

type IntervalClient

type IntervalClient struct {
	// contains filtered or unexported fields
}

IntervalClient is a client for the Interval schema.

func NewIntervalClient

func NewIntervalClient(c config) *IntervalClient

NewIntervalClient returns a client for the Interval from the given config.

func (*IntervalClient) Create

func (c *IntervalClient) Create() *IntervalCreate

Create returns a builder for creating a Interval entity.

func (*IntervalClient) CreateBulk

func (c *IntervalClient) CreateBulk(builders ...*IntervalCreate) *IntervalCreateBulk

CreateBulk returns a builder for creating a bulk of Interval entities.

func (*IntervalClient) Delete

func (c *IntervalClient) Delete() *IntervalDelete

Delete returns a delete builder for Interval.

func (*IntervalClient) DeleteOne

func (c *IntervalClient) DeleteOne(i *Interval) *IntervalDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*IntervalClient) DeleteOneID

func (c *IntervalClient) DeleteOneID(id int) *IntervalDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*IntervalClient) Get

func (c *IntervalClient) Get(ctx context.Context, id int) (*Interval, error)

Get returns a Interval entity by its id.

func (*IntervalClient) GetX

func (c *IntervalClient) GetX(ctx context.Context, id int) *Interval

GetX is like Get, but panics if an error occurs.

func (*IntervalClient) Hooks

func (c *IntervalClient) Hooks() []Hook

Hooks returns the client hooks.

func (*IntervalClient) Intercept

func (c *IntervalClient) Intercept(interceptors ...Interceptor)

Use adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `interval.Intercept(f(g(h())))`.

func (*IntervalClient) Interceptors

func (c *IntervalClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*IntervalClient) Query

func (c *IntervalClient) Query() *IntervalQuery

Query returns a query builder for Interval.

func (*IntervalClient) QueryBars

func (c *IntervalClient) QueryBars(i *Interval) *BarTimeRangeQuery

QueryBars queries the bars edge of a Interval.

func (*IntervalClient) QueryDataSource

func (c *IntervalClient) QueryDataSource(i *Interval) *DataSourceQuery

QueryDataSource queries the data_source edge of a Interval.

func (*IntervalClient) QueryStock

func (c *IntervalClient) QueryStock(i *Interval) *EntityQuery

QueryStock queries the stock edge of a Interval.

func (*IntervalClient) QueryTrades

func (c *IntervalClient) QueryTrades(i *Interval) *TradeTimeRangeQuery

QueryTrades queries the trades edge of a Interval.

func (*IntervalClient) Update

func (c *IntervalClient) Update() *IntervalUpdate

Update returns an update builder for Interval.

func (*IntervalClient) UpdateOne

func (c *IntervalClient) UpdateOne(i *Interval) *IntervalUpdateOne

UpdateOne returns an update builder for the given entity.

func (*IntervalClient) UpdateOneID

func (c *IntervalClient) UpdateOneID(id int) *IntervalUpdateOne

UpdateOneID returns an update builder for the given id.

func (*IntervalClient) Use

func (c *IntervalClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `interval.Hooks(f(g(h())))`.

type IntervalCreate

type IntervalCreate struct {
	// contains filtered or unexported fields
}

IntervalCreate is the builder for creating a Interval entity.

func (*IntervalCreate) AddBarIDs

func (ic *IntervalCreate) AddBarIDs(ids ...int) *IntervalCreate

AddBarIDs adds the "bars" edge to the BarTimeRange entity by IDs.

func (*IntervalCreate) AddBars

func (ic *IntervalCreate) AddBars(b ...*BarTimeRange) *IntervalCreate

AddBars adds the "bars" edges to the BarTimeRange entity.

func (*IntervalCreate) AddTradeIDs

func (ic *IntervalCreate) AddTradeIDs(ids ...int) *IntervalCreate

AddTradeIDs adds the "trades" edge to the TradeTimeRange entity by IDs.

func (*IntervalCreate) AddTrades

func (ic *IntervalCreate) AddTrades(t ...*TradeTimeRange) *IntervalCreate

AddTrades adds the "trades" edges to the TradeTimeRange entity.

func (*IntervalCreate) Exec

func (ic *IntervalCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*IntervalCreate) ExecX

func (ic *IntervalCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*IntervalCreate) Mutation

func (ic *IntervalCreate) Mutation() *IntervalMutation

Mutation returns the IntervalMutation object of the builder.

func (*IntervalCreate) Save

func (ic *IntervalCreate) Save(ctx context.Context) (*Interval, error)

Save creates the Interval in the database.

func (*IntervalCreate) SaveX

func (ic *IntervalCreate) SaveX(ctx context.Context) *Interval

SaveX calls Save and panics if Save returns an error.

func (*IntervalCreate) SetActive

func (ic *IntervalCreate) SetActive(b bool) *IntervalCreate

SetActive sets the "active" field.

func (*IntervalCreate) SetDataSource

func (ic *IntervalCreate) SetDataSource(d *DataSource) *IntervalCreate

SetDataSource sets the "data_source" edge to the DataSource entity.

func (*IntervalCreate) SetDataSourceID

func (ic *IntervalCreate) SetDataSourceID(i int) *IntervalCreate

SetDataSourceID sets the "data_source_id" field.

func (*IntervalCreate) SetInterval

func (ic *IntervalCreate) SetInterval(i interval.Interval) *IntervalCreate

SetInterval sets the "interval" field.

func (*IntervalCreate) SetNillableActive

func (ic *IntervalCreate) SetNillableActive(b *bool) *IntervalCreate

SetNillableActive sets the "active" field if the given value is not nil.

func (*IntervalCreate) SetStock

func (ic *IntervalCreate) SetStock(e *Entity) *IntervalCreate

SetStock sets the "stock" edge to the Entity entity.

func (*IntervalCreate) SetStockID

func (ic *IntervalCreate) SetStockID(i int) *IntervalCreate

SetStockID sets the "stock_id" field.

type IntervalCreateBulk

type IntervalCreateBulk struct {
	// contains filtered or unexported fields
}

IntervalCreateBulk is the builder for creating many Interval entities in bulk.

func (*IntervalCreateBulk) Exec

func (icb *IntervalCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*IntervalCreateBulk) ExecX

func (icb *IntervalCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*IntervalCreateBulk) Save

func (icb *IntervalCreateBulk) Save(ctx context.Context) ([]*Interval, error)

Save creates the Interval entities in the database.

func (*IntervalCreateBulk) SaveX

func (icb *IntervalCreateBulk) SaveX(ctx context.Context) []*Interval

SaveX is like Save, but panics if an error occurs.

type IntervalDelete

type IntervalDelete struct {
	// contains filtered or unexported fields
}

IntervalDelete is the builder for deleting a Interval entity.

func (*IntervalDelete) Exec

func (id *IntervalDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*IntervalDelete) ExecX

func (id *IntervalDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*IntervalDelete) Where

func (id *IntervalDelete) Where(ps ...predicate.Interval) *IntervalDelete

Where appends a list predicates to the IntervalDelete builder.

type IntervalDeleteOne

type IntervalDeleteOne struct {
	// contains filtered or unexported fields
}

IntervalDeleteOne is the builder for deleting a single Interval entity.

func (*IntervalDeleteOne) Exec

func (ido *IntervalDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*IntervalDeleteOne) ExecX

func (ido *IntervalDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type IntervalEdges

type IntervalEdges struct {
	// DataSource holds the value of the data_source edge.
	DataSource *DataSource `json:"data_source,omitempty"`
	// Stock holds the value of the stock edge.
	Stock *Entity `json:"stock,omitempty"`
	// Bars holds the value of the bars edge.
	Bars []*BarTimeRange `json:"bars,omitempty"`
	// Trades holds the value of the trades edge.
	Trades []*TradeTimeRange `json:"trades,omitempty"`
	// contains filtered or unexported fields
}

IntervalEdges holds the relations/edges for other nodes in the graph.

func (IntervalEdges) BarsOrErr

func (e IntervalEdges) BarsOrErr() ([]*BarTimeRange, error)

BarsOrErr returns the Bars value or an error if the edge was not loaded in eager-loading.

func (IntervalEdges) DataSourceOrErr

func (e IntervalEdges) DataSourceOrErr() (*DataSource, error)

DataSourceOrErr returns the DataSource value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (IntervalEdges) StockOrErr

func (e IntervalEdges) StockOrErr() (*Entity, error)

StockOrErr returns the Stock value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (IntervalEdges) TradesOrErr

func (e IntervalEdges) TradesOrErr() ([]*TradeTimeRange, error)

TradesOrErr returns the Trades value or an error if the edge was not loaded in eager-loading.

type IntervalGroupBy

type IntervalGroupBy struct {
	// contains filtered or unexported fields
}

IntervalGroupBy is the group-by builder for Interval entities.

func (*IntervalGroupBy) Aggregate

func (igb *IntervalGroupBy) Aggregate(fns ...AggregateFunc) *IntervalGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*IntervalGroupBy) Bool

func (s *IntervalGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*IntervalGroupBy) BoolX

func (s *IntervalGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*IntervalGroupBy) Bools

func (s *IntervalGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*IntervalGroupBy) BoolsX

func (s *IntervalGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*IntervalGroupBy) Float64

func (s *IntervalGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*IntervalGroupBy) Float64X

func (s *IntervalGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*IntervalGroupBy) Float64s

func (s *IntervalGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*IntervalGroupBy) Float64sX

func (s *IntervalGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*IntervalGroupBy) Int

func (s *IntervalGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*IntervalGroupBy) IntX

func (s *IntervalGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*IntervalGroupBy) Ints

func (s *IntervalGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*IntervalGroupBy) IntsX

func (s *IntervalGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*IntervalGroupBy) Scan

func (igb *IntervalGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*IntervalGroupBy) ScanX

func (s *IntervalGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*IntervalGroupBy) String

func (s *IntervalGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*IntervalGroupBy) StringX

func (s *IntervalGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*IntervalGroupBy) Strings

func (s *IntervalGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*IntervalGroupBy) StringsX

func (s *IntervalGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type IntervalMutation

type IntervalMutation struct {
	// contains filtered or unexported fields
}

IntervalMutation represents an operation that mutates the Interval nodes in the graph.

func (*IntervalMutation) Active

func (m *IntervalMutation) Active() (r bool, exists bool)

Active returns the value of the "active" field in the mutation.

func (*IntervalMutation) AddBarIDs

func (m *IntervalMutation) AddBarIDs(ids ...int)

AddBarIDs adds the "bars" edge to the BarTimeRange entity by ids.

func (*IntervalMutation) AddField

func (m *IntervalMutation) 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 (*IntervalMutation) AddTradeIDs

func (m *IntervalMutation) AddTradeIDs(ids ...int)

AddTradeIDs adds the "trades" edge to the TradeTimeRange entity by ids.

func (*IntervalMutation) AddedEdges

func (m *IntervalMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*IntervalMutation) AddedField

func (m *IntervalMutation) 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 (*IntervalMutation) AddedFields

func (m *IntervalMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*IntervalMutation) AddedIDs

func (m *IntervalMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*IntervalMutation) BarsCleared

func (m *IntervalMutation) BarsCleared() bool

BarsCleared reports if the "bars" edge to the BarTimeRange entity was cleared.

func (*IntervalMutation) BarsIDs

func (m *IntervalMutation) BarsIDs() (ids []int)

BarsIDs returns the "bars" edge IDs in the mutation.

func (*IntervalMutation) ClearBars

func (m *IntervalMutation) ClearBars()

ClearBars clears the "bars" edge to the BarTimeRange entity.

func (*IntervalMutation) ClearDataSource

func (m *IntervalMutation) ClearDataSource()

ClearDataSource clears the "data_source" edge to the DataSource entity.

func (*IntervalMutation) ClearEdge

func (m *IntervalMutation) 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 (*IntervalMutation) ClearField

func (m *IntervalMutation) 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 (*IntervalMutation) ClearStock

func (m *IntervalMutation) ClearStock()

ClearStock clears the "stock" edge to the Entity entity.

func (*IntervalMutation) ClearTrades

func (m *IntervalMutation) ClearTrades()

ClearTrades clears the "trades" edge to the TradeTimeRange entity.

func (*IntervalMutation) ClearedEdges

func (m *IntervalMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*IntervalMutation) ClearedFields

func (m *IntervalMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (IntervalMutation) Client

func (m IntervalMutation) 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 (*IntervalMutation) DataSourceCleared

func (m *IntervalMutation) DataSourceCleared() bool

DataSourceCleared reports if the "data_source" edge to the DataSource entity was cleared.

func (*IntervalMutation) DataSourceID

func (m *IntervalMutation) DataSourceID() (r int, exists bool)

DataSourceID returns the value of the "data_source_id" field in the mutation.

func (*IntervalMutation) DataSourceIDs

func (m *IntervalMutation) DataSourceIDs() (ids []int)

DataSourceIDs returns the "data_source" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use DataSourceID instead. It exists only for internal usage by the builders.

func (*IntervalMutation) EdgeCleared

func (m *IntervalMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*IntervalMutation) Field

func (m *IntervalMutation) 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 (*IntervalMutation) FieldCleared

func (m *IntervalMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*IntervalMutation) Fields

func (m *IntervalMutation) 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 (*IntervalMutation) ID

func (m *IntervalMutation) 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 (*IntervalMutation) IDs

func (m *IntervalMutation) 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 (*IntervalMutation) Interval

func (m *IntervalMutation) Interval() (r interval.Interval, exists bool)

Interval returns the value of the "interval" field in the mutation.

func (*IntervalMutation) OldActive

func (m *IntervalMutation) OldActive(ctx context.Context) (v bool, err error)

OldActive returns the old "active" field's value of the Interval entity. If the Interval 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 (*IntervalMutation) OldDataSourceID

func (m *IntervalMutation) OldDataSourceID(ctx context.Context) (v int, err error)

OldDataSourceID returns the old "data_source_id" field's value of the Interval entity. If the Interval 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 (*IntervalMutation) OldField

func (m *IntervalMutation) 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 (*IntervalMutation) OldInterval

func (m *IntervalMutation) OldInterval(ctx context.Context) (v interval.Interval, err error)

OldInterval returns the old "interval" field's value of the Interval entity. If the Interval 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 (*IntervalMutation) OldStockID

func (m *IntervalMutation) OldStockID(ctx context.Context) (v int, err error)

OldStockID returns the old "stock_id" field's value of the Interval entity. If the Interval 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 (*IntervalMutation) Op

func (m *IntervalMutation) Op() Op

Op returns the operation name.

func (*IntervalMutation) RemoveBarIDs

func (m *IntervalMutation) RemoveBarIDs(ids ...int)

RemoveBarIDs removes the "bars" edge to the BarTimeRange entity by IDs.

func (*IntervalMutation) RemoveTradeIDs

func (m *IntervalMutation) RemoveTradeIDs(ids ...int)

RemoveTradeIDs removes the "trades" edge to the TradeTimeRange entity by IDs.

func (*IntervalMutation) RemovedBarsIDs

func (m *IntervalMutation) RemovedBarsIDs() (ids []int)

RemovedBars returns the removed IDs of the "bars" edge to the BarTimeRange entity.

func (*IntervalMutation) RemovedEdges

func (m *IntervalMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*IntervalMutation) RemovedIDs

func (m *IntervalMutation) 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 (*IntervalMutation) RemovedTradesIDs

func (m *IntervalMutation) RemovedTradesIDs() (ids []int)

RemovedTrades returns the removed IDs of the "trades" edge to the TradeTimeRange entity.

func (*IntervalMutation) ResetActive

func (m *IntervalMutation) ResetActive()

ResetActive resets all changes to the "active" field.

func (*IntervalMutation) ResetBars

func (m *IntervalMutation) ResetBars()

ResetBars resets all changes to the "bars" edge.

func (*IntervalMutation) ResetDataSource

func (m *IntervalMutation) ResetDataSource()

ResetDataSource resets all changes to the "data_source" edge.

func (*IntervalMutation) ResetDataSourceID

func (m *IntervalMutation) ResetDataSourceID()

ResetDataSourceID resets all changes to the "data_source_id" field.

func (*IntervalMutation) ResetEdge

func (m *IntervalMutation) 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 (*IntervalMutation) ResetField

func (m *IntervalMutation) 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 (*IntervalMutation) ResetInterval

func (m *IntervalMutation) ResetInterval()

ResetInterval resets all changes to the "interval" field.

func (*IntervalMutation) ResetStock

func (m *IntervalMutation) ResetStock()

ResetStock resets all changes to the "stock" edge.

func (*IntervalMutation) ResetStockID

func (m *IntervalMutation) ResetStockID()

ResetStockID resets all changes to the "stock_id" field.

func (*IntervalMutation) ResetTrades

func (m *IntervalMutation) ResetTrades()

ResetTrades resets all changes to the "trades" edge.

func (*IntervalMutation) SetActive

func (m *IntervalMutation) SetActive(b bool)

SetActive sets the "active" field.

func (*IntervalMutation) SetDataSourceID

func (m *IntervalMutation) SetDataSourceID(i int)

SetDataSourceID sets the "data_source_id" field.

func (*IntervalMutation) SetField

func (m *IntervalMutation) 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 (*IntervalMutation) SetInterval

func (m *IntervalMutation) SetInterval(i interval.Interval)

SetInterval sets the "interval" field.

func (*IntervalMutation) SetOp

func (m *IntervalMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*IntervalMutation) SetStockID

func (m *IntervalMutation) SetStockID(i int)

SetStockID sets the "stock_id" field.

func (*IntervalMutation) StockCleared

func (m *IntervalMutation) StockCleared() bool

StockCleared reports if the "stock" edge to the Entity entity was cleared.

func (*IntervalMutation) StockID

func (m *IntervalMutation) StockID() (r int, exists bool)

StockID returns the value of the "stock_id" field in the mutation.

func (*IntervalMutation) StockIDs

func (m *IntervalMutation) StockIDs() (ids []int)

StockIDs returns the "stock" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use StockID instead. It exists only for internal usage by the builders.

func (*IntervalMutation) TradesCleared

func (m *IntervalMutation) TradesCleared() bool

TradesCleared reports if the "trades" edge to the TradeTimeRange entity was cleared.

func (*IntervalMutation) TradesIDs

func (m *IntervalMutation) TradesIDs() (ids []int)

TradesIDs returns the "trades" edge IDs in the mutation.

func (IntervalMutation) Tx

func (m IntervalMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*IntervalMutation) Type

func (m *IntervalMutation) Type() string

Type returns the node type of this mutation (Interval).

func (*IntervalMutation) Where

func (m *IntervalMutation) Where(ps ...predicate.Interval)

Where appends a list predicates to the IntervalMutation builder.

func (*IntervalMutation) WhereP

func (m *IntervalMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the IntervalMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type IntervalQuery

type IntervalQuery struct {
	// contains filtered or unexported fields
}

IntervalQuery is the builder for querying Interval entities.

func (*IntervalQuery) Aggregate

func (iq *IntervalQuery) Aggregate(fns ...AggregateFunc) *IntervalSelect

Aggregate returns a IntervalSelect configured with the given aggregations.

func (*IntervalQuery) All

func (iq *IntervalQuery) All(ctx context.Context) ([]*Interval, error)

All executes the query and returns a list of Intervals.

func (*IntervalQuery) AllX

func (iq *IntervalQuery) AllX(ctx context.Context) []*Interval

AllX is like All, but panics if an error occurs.

func (*IntervalQuery) Clone

func (iq *IntervalQuery) Clone() *IntervalQuery

Clone returns a duplicate of the IntervalQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*IntervalQuery) Count

func (iq *IntervalQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*IntervalQuery) CountX

func (iq *IntervalQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*IntervalQuery) Exist

func (iq *IntervalQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*IntervalQuery) ExistX

func (iq *IntervalQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*IntervalQuery) First

func (iq *IntervalQuery) First(ctx context.Context) (*Interval, error)

First returns the first Interval entity from the query. Returns a *NotFoundError when no Interval was found.

func (*IntervalQuery) FirstID

func (iq *IntervalQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Interval ID from the query. Returns a *NotFoundError when no Interval ID was found.

func (*IntervalQuery) FirstIDX

func (iq *IntervalQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*IntervalQuery) FirstX

func (iq *IntervalQuery) FirstX(ctx context.Context) *Interval

FirstX is like First, but panics if an error occurs.

func (*IntervalQuery) GroupBy

func (iq *IntervalQuery) GroupBy(field string, fields ...string) *IntervalGroupBy

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 {
	Active bool `json:"active,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Interval.Query().
	GroupBy(interval.FieldActive).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*IntervalQuery) IDs

func (iq *IntervalQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of Interval IDs.

func (*IntervalQuery) IDsX

func (iq *IntervalQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*IntervalQuery) Limit

func (iq *IntervalQuery) Limit(limit int) *IntervalQuery

Limit the number of records to be returned by this query.

func (*IntervalQuery) Offset

func (iq *IntervalQuery) Offset(offset int) *IntervalQuery

Offset to start from.

func (*IntervalQuery) Only

func (iq *IntervalQuery) Only(ctx context.Context) (*Interval, error)

Only returns a single Interval entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Interval entity is found. Returns a *NotFoundError when no Interval entities are found.

func (*IntervalQuery) OnlyID

func (iq *IntervalQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Interval ID in the query. Returns a *NotSingularError when more than one Interval ID is found. Returns a *NotFoundError when no entities are found.

func (*IntervalQuery) OnlyIDX

func (iq *IntervalQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*IntervalQuery) OnlyX

func (iq *IntervalQuery) OnlyX(ctx context.Context) *Interval

OnlyX is like Only, but panics if an error occurs.

func (*IntervalQuery) Order

func (iq *IntervalQuery) Order(o ...OrderFunc) *IntervalQuery

Order specifies how the records should be ordered.

func (*IntervalQuery) QueryBars

func (iq *IntervalQuery) QueryBars() *BarTimeRangeQuery

QueryBars chains the current query on the "bars" edge.

func (*IntervalQuery) QueryDataSource

func (iq *IntervalQuery) QueryDataSource() *DataSourceQuery

QueryDataSource chains the current query on the "data_source" edge.

func (*IntervalQuery) QueryStock

func (iq *IntervalQuery) QueryStock() *EntityQuery

QueryStock chains the current query on the "stock" edge.

func (*IntervalQuery) QueryTrades

func (iq *IntervalQuery) QueryTrades() *TradeTimeRangeQuery

QueryTrades chains the current query on the "trades" edge.

func (*IntervalQuery) Select

func (iq *IntervalQuery) Select(fields ...string) *IntervalSelect

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 {
	Active bool `json:"active,omitempty"`
}

client.Interval.Query().
	Select(interval.FieldActive).
	Scan(ctx, &v)

func (*IntervalQuery) Unique

func (iq *IntervalQuery) Unique(unique bool) *IntervalQuery

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 (*IntervalQuery) Where

func (iq *IntervalQuery) Where(ps ...predicate.Interval) *IntervalQuery

Where adds a new predicate for the IntervalQuery builder.

func (*IntervalQuery) WithBars

func (iq *IntervalQuery) WithBars(opts ...func(*BarTimeRangeQuery)) *IntervalQuery

WithBars tells the query-builder to eager-load the nodes that are connected to the "bars" edge. The optional arguments are used to configure the query builder of the edge.

func (*IntervalQuery) WithDataSource

func (iq *IntervalQuery) WithDataSource(opts ...func(*DataSourceQuery)) *IntervalQuery

WithDataSource tells the query-builder to eager-load the nodes that are connected to the "data_source" edge. The optional arguments are used to configure the query builder of the edge.

func (*IntervalQuery) WithStock

func (iq *IntervalQuery) WithStock(opts ...func(*EntityQuery)) *IntervalQuery

WithStock tells the query-builder to eager-load the nodes that are connected to the "stock" edge. The optional arguments are used to configure the query builder of the edge.

func (*IntervalQuery) WithTrades

func (iq *IntervalQuery) WithTrades(opts ...func(*TradeTimeRangeQuery)) *IntervalQuery

WithTrades tells the query-builder to eager-load the nodes that are connected to the "trades" edge. The optional arguments are used to configure the query builder of the edge.

type IntervalSelect

type IntervalSelect struct {
	*IntervalQuery
	// contains filtered or unexported fields
}

IntervalSelect is the builder for selecting fields of Interval entities.

func (*IntervalSelect) Aggregate

func (is *IntervalSelect) Aggregate(fns ...AggregateFunc) *IntervalSelect

Aggregate adds the given aggregation functions to the selector query.

func (*IntervalSelect) Bool

func (s *IntervalSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*IntervalSelect) BoolX

func (s *IntervalSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*IntervalSelect) Bools

func (s *IntervalSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*IntervalSelect) BoolsX

func (s *IntervalSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*IntervalSelect) Float64

func (s *IntervalSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*IntervalSelect) Float64X

func (s *IntervalSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*IntervalSelect) Float64s

func (s *IntervalSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*IntervalSelect) Float64sX

func (s *IntervalSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*IntervalSelect) Int

func (s *IntervalSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*IntervalSelect) IntX

func (s *IntervalSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*IntervalSelect) Ints

func (s *IntervalSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*IntervalSelect) IntsX

func (s *IntervalSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*IntervalSelect) Scan

func (is *IntervalSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*IntervalSelect) ScanX

func (s *IntervalSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*IntervalSelect) String

func (s *IntervalSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*IntervalSelect) StringX

func (s *IntervalSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*IntervalSelect) Strings

func (s *IntervalSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*IntervalSelect) StringsX

func (s *IntervalSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type IntervalUpdate

type IntervalUpdate struct {
	// contains filtered or unexported fields
}

IntervalUpdate is the builder for updating Interval entities.

func (*IntervalUpdate) AddBarIDs

func (iu *IntervalUpdate) AddBarIDs(ids ...int) *IntervalUpdate

AddBarIDs adds the "bars" edge to the BarTimeRange entity by IDs.

func (*IntervalUpdate) AddBars

func (iu *IntervalUpdate) AddBars(b ...*BarTimeRange) *IntervalUpdate

AddBars adds the "bars" edges to the BarTimeRange entity.

func (*IntervalUpdate) AddTradeIDs

func (iu *IntervalUpdate) AddTradeIDs(ids ...int) *IntervalUpdate

AddTradeIDs adds the "trades" edge to the TradeTimeRange entity by IDs.

func (*IntervalUpdate) AddTrades

func (iu *IntervalUpdate) AddTrades(t ...*TradeTimeRange) *IntervalUpdate

AddTrades adds the "trades" edges to the TradeTimeRange entity.

func (*IntervalUpdate) ClearBars

func (iu *IntervalUpdate) ClearBars() *IntervalUpdate

ClearBars clears all "bars" edges to the BarTimeRange entity.

func (*IntervalUpdate) ClearDataSource

func (iu *IntervalUpdate) ClearDataSource() *IntervalUpdate

ClearDataSource clears the "data_source" edge to the DataSource entity.

func (*IntervalUpdate) ClearStock

func (iu *IntervalUpdate) ClearStock() *IntervalUpdate

ClearStock clears the "stock" edge to the Entity entity.

func (*IntervalUpdate) ClearTrades

func (iu *IntervalUpdate) ClearTrades() *IntervalUpdate

ClearTrades clears all "trades" edges to the TradeTimeRange entity.

func (*IntervalUpdate) Exec

func (iu *IntervalUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*IntervalUpdate) ExecX

func (iu *IntervalUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*IntervalUpdate) Mutation

func (iu *IntervalUpdate) Mutation() *IntervalMutation

Mutation returns the IntervalMutation object of the builder.

func (*IntervalUpdate) RemoveBarIDs

func (iu *IntervalUpdate) RemoveBarIDs(ids ...int) *IntervalUpdate

RemoveBarIDs removes the "bars" edge to BarTimeRange entities by IDs.

func (*IntervalUpdate) RemoveBars

func (iu *IntervalUpdate) RemoveBars(b ...*BarTimeRange) *IntervalUpdate

RemoveBars removes "bars" edges to BarTimeRange entities.

func (*IntervalUpdate) RemoveTradeIDs

func (iu *IntervalUpdate) RemoveTradeIDs(ids ...int) *IntervalUpdate

RemoveTradeIDs removes the "trades" edge to TradeTimeRange entities by IDs.

func (*IntervalUpdate) RemoveTrades

func (iu *IntervalUpdate) RemoveTrades(t ...*TradeTimeRange) *IntervalUpdate

RemoveTrades removes "trades" edges to TradeTimeRange entities.

func (*IntervalUpdate) Save

func (iu *IntervalUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*IntervalUpdate) SaveX

func (iu *IntervalUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*IntervalUpdate) SetActive

func (iu *IntervalUpdate) SetActive(b bool) *IntervalUpdate

SetActive sets the "active" field.

func (*IntervalUpdate) SetDataSource

func (iu *IntervalUpdate) SetDataSource(d *DataSource) *IntervalUpdate

SetDataSource sets the "data_source" edge to the DataSource entity.

func (*IntervalUpdate) SetDataSourceID

func (iu *IntervalUpdate) SetDataSourceID(i int) *IntervalUpdate

SetDataSourceID sets the "data_source_id" field.

func (*IntervalUpdate) SetInterval

func (iu *IntervalUpdate) SetInterval(i interval.Interval) *IntervalUpdate

SetInterval sets the "interval" field.

func (*IntervalUpdate) SetNillableActive

func (iu *IntervalUpdate) SetNillableActive(b *bool) *IntervalUpdate

SetNillableActive sets the "active" field if the given value is not nil.

func (*IntervalUpdate) SetStock

func (iu *IntervalUpdate) SetStock(e *Entity) *IntervalUpdate

SetStock sets the "stock" edge to the Entity entity.

func (*IntervalUpdate) SetStockID

func (iu *IntervalUpdate) SetStockID(i int) *IntervalUpdate

SetStockID sets the "stock_id" field.

func (*IntervalUpdate) Where

func (iu *IntervalUpdate) Where(ps ...predicate.Interval) *IntervalUpdate

Where appends a list predicates to the IntervalUpdate builder.

type IntervalUpdateOne

type IntervalUpdateOne struct {
	// contains filtered or unexported fields
}

IntervalUpdateOne is the builder for updating a single Interval entity.

func (*IntervalUpdateOne) AddBarIDs

func (iuo *IntervalUpdateOne) AddBarIDs(ids ...int) *IntervalUpdateOne

AddBarIDs adds the "bars" edge to the BarTimeRange entity by IDs.

func (*IntervalUpdateOne) AddBars

func (iuo *IntervalUpdateOne) AddBars(b ...*BarTimeRange) *IntervalUpdateOne

AddBars adds the "bars" edges to the BarTimeRange entity.

func (*IntervalUpdateOne) AddTradeIDs

func (iuo *IntervalUpdateOne) AddTradeIDs(ids ...int) *IntervalUpdateOne

AddTradeIDs adds the "trades" edge to the TradeTimeRange entity by IDs.

func (*IntervalUpdateOne) AddTrades

func (iuo *IntervalUpdateOne) AddTrades(t ...*TradeTimeRange) *IntervalUpdateOne

AddTrades adds the "trades" edges to the TradeTimeRange entity.

func (*IntervalUpdateOne) ClearBars

func (iuo *IntervalUpdateOne) ClearBars() *IntervalUpdateOne

ClearBars clears all "bars" edges to the BarTimeRange entity.

func (*IntervalUpdateOne) ClearDataSource

func (iuo *IntervalUpdateOne) ClearDataSource() *IntervalUpdateOne

ClearDataSource clears the "data_source" edge to the DataSource entity.

func (*IntervalUpdateOne) ClearStock

func (iuo *IntervalUpdateOne) ClearStock() *IntervalUpdateOne

ClearStock clears the "stock" edge to the Entity entity.

func (*IntervalUpdateOne) ClearTrades

func (iuo *IntervalUpdateOne) ClearTrades() *IntervalUpdateOne

ClearTrades clears all "trades" edges to the TradeTimeRange entity.

func (*IntervalUpdateOne) Exec

func (iuo *IntervalUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*IntervalUpdateOne) ExecX

func (iuo *IntervalUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*IntervalUpdateOne) Mutation

func (iuo *IntervalUpdateOne) Mutation() *IntervalMutation

Mutation returns the IntervalMutation object of the builder.

func (*IntervalUpdateOne) RemoveBarIDs

func (iuo *IntervalUpdateOne) RemoveBarIDs(ids ...int) *IntervalUpdateOne

RemoveBarIDs removes the "bars" edge to BarTimeRange entities by IDs.

func (*IntervalUpdateOne) RemoveBars

func (iuo *IntervalUpdateOne) RemoveBars(b ...*BarTimeRange) *IntervalUpdateOne

RemoveBars removes "bars" edges to BarTimeRange entities.

func (*IntervalUpdateOne) RemoveTradeIDs

func (iuo *IntervalUpdateOne) RemoveTradeIDs(ids ...int) *IntervalUpdateOne

RemoveTradeIDs removes the "trades" edge to TradeTimeRange entities by IDs.

func (*IntervalUpdateOne) RemoveTrades

func (iuo *IntervalUpdateOne) RemoveTrades(t ...*TradeTimeRange) *IntervalUpdateOne

RemoveTrades removes "trades" edges to TradeTimeRange entities.

func (*IntervalUpdateOne) Save

func (iuo *IntervalUpdateOne) Save(ctx context.Context) (*Interval, error)

Save executes the query and returns the updated Interval entity.

func (*IntervalUpdateOne) SaveX

func (iuo *IntervalUpdateOne) SaveX(ctx context.Context) *Interval

SaveX is like Save, but panics if an error occurs.

func (*IntervalUpdateOne) Select

func (iuo *IntervalUpdateOne) Select(field string, fields ...string) *IntervalUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*IntervalUpdateOne) SetActive

func (iuo *IntervalUpdateOne) SetActive(b bool) *IntervalUpdateOne

SetActive sets the "active" field.

func (*IntervalUpdateOne) SetDataSource

func (iuo *IntervalUpdateOne) SetDataSource(d *DataSource) *IntervalUpdateOne

SetDataSource sets the "data_source" edge to the DataSource entity.

func (*IntervalUpdateOne) SetDataSourceID

func (iuo *IntervalUpdateOne) SetDataSourceID(i int) *IntervalUpdateOne

SetDataSourceID sets the "data_source_id" field.

func (*IntervalUpdateOne) SetInterval

SetInterval sets the "interval" field.

func (*IntervalUpdateOne) SetNillableActive

func (iuo *IntervalUpdateOne) SetNillableActive(b *bool) *IntervalUpdateOne

SetNillableActive sets the "active" field if the given value is not nil.

func (*IntervalUpdateOne) SetStock

func (iuo *IntervalUpdateOne) SetStock(e *Entity) *IntervalUpdateOne

SetStock sets the "stock" edge to the Entity entity.

func (*IntervalUpdateOne) SetStockID

func (iuo *IntervalUpdateOne) SetStockID(i int) *IntervalUpdateOne

SetStockID sets the "stock_id" field.

type Intervals

type Intervals []*Interval

Intervals is a parsable slice of Interval.

type MarketHours

type MarketHours struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Date holds the value of the "date" field.
	Date time.Time `json:"date,omitempty"`
	// StartTime holds the value of the "start_time" field.
	StartTime time.Time `json:"start_time,omitempty"`
	// EndTime holds the value of the "end_time" field.
	EndTime time.Time `json:"end_time,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MarketHoursQuery when eager-loading is set.
	Edges MarketHoursEdges `json:"edges"`
	// contains filtered or unexported fields
}

MarketHours is the model entity for the MarketHours schema.

func (*MarketHours) QueryMarketInfo

func (mh *MarketHours) QueryMarketInfo() *MarketInfoQuery

QueryMarketInfo queries the "market_info" edge of the MarketHours entity.

func (*MarketHours) String

func (mh *MarketHours) String() string

String implements the fmt.Stringer.

func (*MarketHours) Unwrap

func (mh *MarketHours) Unwrap() *MarketHours

Unwrap unwraps the MarketHours 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 (*MarketHours) Update

func (mh *MarketHours) Update() *MarketHoursUpdateOne

Update returns a builder for updating this MarketHours. Note that you need to call MarketHours.Unwrap() before calling this method if this MarketHours was returned from a transaction, and the transaction was committed or rolled back.

type MarketHoursClient

type MarketHoursClient struct {
	// contains filtered or unexported fields
}

MarketHoursClient is a client for the MarketHours schema.

func NewMarketHoursClient

func NewMarketHoursClient(c config) *MarketHoursClient

NewMarketHoursClient returns a client for the MarketHours from the given config.

func (*MarketHoursClient) Create

func (c *MarketHoursClient) Create() *MarketHoursCreate

Create returns a builder for creating a MarketHours entity.

func (*MarketHoursClient) CreateBulk

func (c *MarketHoursClient) CreateBulk(builders ...*MarketHoursCreate) *MarketHoursCreateBulk

CreateBulk returns a builder for creating a bulk of MarketHours entities.

func (*MarketHoursClient) Delete

func (c *MarketHoursClient) Delete() *MarketHoursDelete

Delete returns a delete builder for MarketHours.

func (*MarketHoursClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*MarketHoursClient) DeleteOneID

func (c *MarketHoursClient) DeleteOneID(id int) *MarketHoursDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*MarketHoursClient) Get

func (c *MarketHoursClient) Get(ctx context.Context, id int) (*MarketHours, error)

Get returns a MarketHours entity by its id.

func (*MarketHoursClient) GetX

func (c *MarketHoursClient) GetX(ctx context.Context, id int) *MarketHours

GetX is like Get, but panics if an error occurs.

func (*MarketHoursClient) Hooks

func (c *MarketHoursClient) Hooks() []Hook

Hooks returns the client hooks.

func (*MarketHoursClient) Intercept

func (c *MarketHoursClient) Intercept(interceptors ...Interceptor)

Use adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `markethours.Intercept(f(g(h())))`.

func (*MarketHoursClient) Interceptors

func (c *MarketHoursClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*MarketHoursClient) Query

func (c *MarketHoursClient) Query() *MarketHoursQuery

Query returns a query builder for MarketHours.

func (*MarketHoursClient) QueryMarketInfo

func (c *MarketHoursClient) QueryMarketInfo(mh *MarketHours) *MarketInfoQuery

QueryMarketInfo queries the market_info edge of a MarketHours.

func (*MarketHoursClient) Update

func (c *MarketHoursClient) Update() *MarketHoursUpdate

Update returns an update builder for MarketHours.

func (*MarketHoursClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*MarketHoursClient) UpdateOneID

func (c *MarketHoursClient) UpdateOneID(id int) *MarketHoursUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MarketHoursClient) Use

func (c *MarketHoursClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `markethours.Hooks(f(g(h())))`.

type MarketHoursCreate

type MarketHoursCreate struct {
	// contains filtered or unexported fields
}

MarketHoursCreate is the builder for creating a MarketHours entity.

func (*MarketHoursCreate) Exec

func (mhc *MarketHoursCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MarketHoursCreate) ExecX

func (mhc *MarketHoursCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MarketHoursCreate) Mutation

func (mhc *MarketHoursCreate) Mutation() *MarketHoursMutation

Mutation returns the MarketHoursMutation object of the builder.

func (*MarketHoursCreate) Save

func (mhc *MarketHoursCreate) Save(ctx context.Context) (*MarketHours, error)

Save creates the MarketHours in the database.

func (*MarketHoursCreate) SaveX

func (mhc *MarketHoursCreate) SaveX(ctx context.Context) *MarketHours

SaveX calls Save and panics if Save returns an error.

func (*MarketHoursCreate) SetDate

func (mhc *MarketHoursCreate) SetDate(t time.Time) *MarketHoursCreate

SetDate sets the "date" field.

func (*MarketHoursCreate) SetEndTime

func (mhc *MarketHoursCreate) SetEndTime(t time.Time) *MarketHoursCreate

SetEndTime sets the "end_time" field.

func (*MarketHoursCreate) SetMarketInfo

func (mhc *MarketHoursCreate) SetMarketInfo(m *MarketInfo) *MarketHoursCreate

SetMarketInfo sets the "market_info" edge to the MarketInfo entity.

func (*MarketHoursCreate) SetMarketInfoID

func (mhc *MarketHoursCreate) SetMarketInfoID(id int) *MarketHoursCreate

SetMarketInfoID sets the "market_info" edge to the MarketInfo entity by ID.

func (*MarketHoursCreate) SetNillableMarketInfoID

func (mhc *MarketHoursCreate) SetNillableMarketInfoID(id *int) *MarketHoursCreate

SetNillableMarketInfoID sets the "market_info" edge to the MarketInfo entity by ID if the given value is not nil.

func (*MarketHoursCreate) SetStartTime

func (mhc *MarketHoursCreate) SetStartTime(t time.Time) *MarketHoursCreate

SetStartTime sets the "start_time" field.

type MarketHoursCreateBulk

type MarketHoursCreateBulk struct {
	// contains filtered or unexported fields
}

MarketHoursCreateBulk is the builder for creating many MarketHours entities in bulk.

func (*MarketHoursCreateBulk) Exec

func (mhcb *MarketHoursCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*MarketHoursCreateBulk) ExecX

func (mhcb *MarketHoursCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MarketHoursCreateBulk) Save

func (mhcb *MarketHoursCreateBulk) Save(ctx context.Context) ([]*MarketHours, error)

Save creates the MarketHours entities in the database.

func (*MarketHoursCreateBulk) SaveX

func (mhcb *MarketHoursCreateBulk) SaveX(ctx context.Context) []*MarketHours

SaveX is like Save, but panics if an error occurs.

type MarketHoursDelete

type MarketHoursDelete struct {
	// contains filtered or unexported fields
}

MarketHoursDelete is the builder for deleting a MarketHours entity.

func (*MarketHoursDelete) Exec

func (mhd *MarketHoursDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*MarketHoursDelete) ExecX

func (mhd *MarketHoursDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*MarketHoursDelete) Where

Where appends a list predicates to the MarketHoursDelete builder.

type MarketHoursDeleteOne

type MarketHoursDeleteOne struct {
	// contains filtered or unexported fields
}

MarketHoursDeleteOne is the builder for deleting a single MarketHours entity.

func (*MarketHoursDeleteOne) Exec

func (mhdo *MarketHoursDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MarketHoursDeleteOne) ExecX

func (mhdo *MarketHoursDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type MarketHoursEdges

type MarketHoursEdges struct {
	// MarketInfo holds the value of the market_info edge.
	MarketInfo *MarketInfo `json:"market_info,omitempty"`
	// contains filtered or unexported fields
}

MarketHoursEdges holds the relations/edges for other nodes in the graph.

func (MarketHoursEdges) MarketInfoOrErr

func (e MarketHoursEdges) MarketInfoOrErr() (*MarketInfo, error)

MarketInfoOrErr returns the MarketInfo value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type MarketHoursGroupBy

type MarketHoursGroupBy struct {
	// contains filtered or unexported fields
}

MarketHoursGroupBy is the group-by builder for MarketHours entities.

func (*MarketHoursGroupBy) Aggregate

func (mhgb *MarketHoursGroupBy) Aggregate(fns ...AggregateFunc) *MarketHoursGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*MarketHoursGroupBy) Bool

func (s *MarketHoursGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MarketHoursGroupBy) BoolX

func (s *MarketHoursGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MarketHoursGroupBy) Bools

func (s *MarketHoursGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MarketHoursGroupBy) BoolsX

func (s *MarketHoursGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MarketHoursGroupBy) Float64

func (s *MarketHoursGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MarketHoursGroupBy) Float64X

func (s *MarketHoursGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MarketHoursGroupBy) Float64s

func (s *MarketHoursGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MarketHoursGroupBy) Float64sX

func (s *MarketHoursGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MarketHoursGroupBy) Int

func (s *MarketHoursGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MarketHoursGroupBy) IntX

func (s *MarketHoursGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MarketHoursGroupBy) Ints

func (s *MarketHoursGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MarketHoursGroupBy) IntsX

func (s *MarketHoursGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MarketHoursGroupBy) Scan

func (mhgb *MarketHoursGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*MarketHoursGroupBy) ScanX

func (s *MarketHoursGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*MarketHoursGroupBy) String

func (s *MarketHoursGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MarketHoursGroupBy) StringX

func (s *MarketHoursGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MarketHoursGroupBy) Strings

func (s *MarketHoursGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MarketHoursGroupBy) StringsX

func (s *MarketHoursGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MarketHoursMutation

type MarketHoursMutation struct {
	// contains filtered or unexported fields
}

MarketHoursMutation represents an operation that mutates the MarketHours nodes in the graph.

func (*MarketHoursMutation) AddField

func (m *MarketHoursMutation) 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 (*MarketHoursMutation) AddedEdges

func (m *MarketHoursMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*MarketHoursMutation) AddedField

func (m *MarketHoursMutation) 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 (*MarketHoursMutation) AddedFields

func (m *MarketHoursMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*MarketHoursMutation) AddedIDs

func (m *MarketHoursMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*MarketHoursMutation) ClearEdge

func (m *MarketHoursMutation) 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 (*MarketHoursMutation) ClearField

func (m *MarketHoursMutation) 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 (*MarketHoursMutation) ClearMarketInfo

func (m *MarketHoursMutation) ClearMarketInfo()

ClearMarketInfo clears the "market_info" edge to the MarketInfo entity.

func (*MarketHoursMutation) ClearedEdges

func (m *MarketHoursMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*MarketHoursMutation) ClearedFields

func (m *MarketHoursMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (MarketHoursMutation) Client

func (m MarketHoursMutation) 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 (*MarketHoursMutation) Date

func (m *MarketHoursMutation) Date() (r time.Time, exists bool)

Date returns the value of the "date" field in the mutation.

func (*MarketHoursMutation) EdgeCleared

func (m *MarketHoursMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*MarketHoursMutation) EndTime

func (m *MarketHoursMutation) EndTime() (r time.Time, exists bool)

EndTime returns the value of the "end_time" field in the mutation.

func (*MarketHoursMutation) Field

func (m *MarketHoursMutation) 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 (*MarketHoursMutation) FieldCleared

func (m *MarketHoursMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*MarketHoursMutation) Fields

func (m *MarketHoursMutation) 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 (*MarketHoursMutation) ID

func (m *MarketHoursMutation) 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 (*MarketHoursMutation) IDs

func (m *MarketHoursMutation) 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 (*MarketHoursMutation) MarketInfoCleared

func (m *MarketHoursMutation) MarketInfoCleared() bool

MarketInfoCleared reports if the "market_info" edge to the MarketInfo entity was cleared.

func (*MarketHoursMutation) MarketInfoID

func (m *MarketHoursMutation) MarketInfoID() (id int, exists bool)

MarketInfoID returns the "market_info" edge ID in the mutation.

func (*MarketHoursMutation) MarketInfoIDs

func (m *MarketHoursMutation) MarketInfoIDs() (ids []int)

MarketInfoIDs returns the "market_info" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use MarketInfoID instead. It exists only for internal usage by the builders.

func (*MarketHoursMutation) OldDate

func (m *MarketHoursMutation) OldDate(ctx context.Context) (v time.Time, err error)

OldDate returns the old "date" field's value of the MarketHours entity. If the MarketHours 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 (*MarketHoursMutation) OldEndTime

func (m *MarketHoursMutation) OldEndTime(ctx context.Context) (v time.Time, err error)

OldEndTime returns the old "end_time" field's value of the MarketHours entity. If the MarketHours 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 (*MarketHoursMutation) OldField

func (m *MarketHoursMutation) 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 (*MarketHoursMutation) OldStartTime

func (m *MarketHoursMutation) OldStartTime(ctx context.Context) (v time.Time, err error)

OldStartTime returns the old "start_time" field's value of the MarketHours entity. If the MarketHours 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 (*MarketHoursMutation) Op

func (m *MarketHoursMutation) Op() Op

Op returns the operation name.

func (*MarketHoursMutation) RemovedEdges

func (m *MarketHoursMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*MarketHoursMutation) RemovedIDs

func (m *MarketHoursMutation) 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 (*MarketHoursMutation) ResetDate

func (m *MarketHoursMutation) ResetDate()

ResetDate resets all changes to the "date" field.

func (*MarketHoursMutation) ResetEdge

func (m *MarketHoursMutation) 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 (*MarketHoursMutation) ResetEndTime

func (m *MarketHoursMutation) ResetEndTime()

ResetEndTime resets all changes to the "end_time" field.

func (*MarketHoursMutation) ResetField

func (m *MarketHoursMutation) 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 (*MarketHoursMutation) ResetMarketInfo

func (m *MarketHoursMutation) ResetMarketInfo()

ResetMarketInfo resets all changes to the "market_info" edge.

func (*MarketHoursMutation) ResetStartTime

func (m *MarketHoursMutation) ResetStartTime()

ResetStartTime resets all changes to the "start_time" field.

func (*MarketHoursMutation) SetDate

func (m *MarketHoursMutation) SetDate(t time.Time)

SetDate sets the "date" field.

func (*MarketHoursMutation) SetEndTime

func (m *MarketHoursMutation) SetEndTime(t time.Time)

SetEndTime sets the "end_time" field.

func (*MarketHoursMutation) SetField

func (m *MarketHoursMutation) 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 (*MarketHoursMutation) SetMarketInfoID

func (m *MarketHoursMutation) SetMarketInfoID(id int)

SetMarketInfoID sets the "market_info" edge to the MarketInfo entity by id.

func (*MarketHoursMutation) SetOp

func (m *MarketHoursMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*MarketHoursMutation) SetStartTime

func (m *MarketHoursMutation) SetStartTime(t time.Time)

SetStartTime sets the "start_time" field.

func (*MarketHoursMutation) StartTime

func (m *MarketHoursMutation) StartTime() (r time.Time, exists bool)

StartTime returns the value of the "start_time" field in the mutation.

func (MarketHoursMutation) Tx

func (m MarketHoursMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*MarketHoursMutation) Type

func (m *MarketHoursMutation) Type() string

Type returns the node type of this mutation (MarketHours).

func (*MarketHoursMutation) Where

func (m *MarketHoursMutation) Where(ps ...predicate.MarketHours)

Where appends a list predicates to the MarketHoursMutation builder.

func (*MarketHoursMutation) WhereP

func (m *MarketHoursMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the MarketHoursMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type MarketHoursQuery

type MarketHoursQuery struct {
	// contains filtered or unexported fields
}

MarketHoursQuery is the builder for querying MarketHours entities.

func (*MarketHoursQuery) Aggregate

func (mhq *MarketHoursQuery) Aggregate(fns ...AggregateFunc) *MarketHoursSelect

Aggregate returns a MarketHoursSelect configured with the given aggregations.

func (*MarketHoursQuery) All

func (mhq *MarketHoursQuery) All(ctx context.Context) ([]*MarketHours, error)

All executes the query and returns a list of MarketHoursSlice.

func (*MarketHoursQuery) AllX

func (mhq *MarketHoursQuery) AllX(ctx context.Context) []*MarketHours

AllX is like All, but panics if an error occurs.

func (*MarketHoursQuery) Clone

func (mhq *MarketHoursQuery) Clone() *MarketHoursQuery

Clone returns a duplicate of the MarketHoursQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*MarketHoursQuery) Count

func (mhq *MarketHoursQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MarketHoursQuery) CountX

func (mhq *MarketHoursQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*MarketHoursQuery) Exist

func (mhq *MarketHoursQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*MarketHoursQuery) ExistX

func (mhq *MarketHoursQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*MarketHoursQuery) First

func (mhq *MarketHoursQuery) First(ctx context.Context) (*MarketHours, error)

First returns the first MarketHours entity from the query. Returns a *NotFoundError when no MarketHours was found.

func (*MarketHoursQuery) FirstID

func (mhq *MarketHoursQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first MarketHours ID from the query. Returns a *NotFoundError when no MarketHours ID was found.

func (*MarketHoursQuery) FirstIDX

func (mhq *MarketHoursQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*MarketHoursQuery) FirstX

func (mhq *MarketHoursQuery) FirstX(ctx context.Context) *MarketHours

FirstX is like First, but panics if an error occurs.

func (*MarketHoursQuery) GroupBy

func (mhq *MarketHoursQuery) GroupBy(field string, fields ...string) *MarketHoursGroupBy

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 {
	Date time.Time `json:"date,omitempty"`
	Count int `json:"count,omitempty"`
}

client.MarketHours.Query().
	GroupBy(markethours.FieldDate).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MarketHoursQuery) IDs

func (mhq *MarketHoursQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of MarketHours IDs.

func (*MarketHoursQuery) IDsX

func (mhq *MarketHoursQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*MarketHoursQuery) Limit

func (mhq *MarketHoursQuery) Limit(limit int) *MarketHoursQuery

Limit the number of records to be returned by this query.

func (*MarketHoursQuery) Offset

func (mhq *MarketHoursQuery) Offset(offset int) *MarketHoursQuery

Offset to start from.

func (*MarketHoursQuery) Only

func (mhq *MarketHoursQuery) Only(ctx context.Context) (*MarketHours, error)

Only returns a single MarketHours entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one MarketHours entity is found. Returns a *NotFoundError when no MarketHours entities are found.

func (*MarketHoursQuery) OnlyID

func (mhq *MarketHoursQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only MarketHours ID in the query. Returns a *NotSingularError when more than one MarketHours ID is found. Returns a *NotFoundError when no entities are found.

func (*MarketHoursQuery) OnlyIDX

func (mhq *MarketHoursQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*MarketHoursQuery) OnlyX

func (mhq *MarketHoursQuery) OnlyX(ctx context.Context) *MarketHours

OnlyX is like Only, but panics if an error occurs.

func (*MarketHoursQuery) Order

func (mhq *MarketHoursQuery) Order(o ...OrderFunc) *MarketHoursQuery

Order specifies how the records should be ordered.

func (*MarketHoursQuery) QueryMarketInfo

func (mhq *MarketHoursQuery) QueryMarketInfo() *MarketInfoQuery

QueryMarketInfo chains the current query on the "market_info" edge.

func (*MarketHoursQuery) Select

func (mhq *MarketHoursQuery) Select(fields ...string) *MarketHoursSelect

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 {
	Date time.Time `json:"date,omitempty"`
}

client.MarketHours.Query().
	Select(markethours.FieldDate).
	Scan(ctx, &v)

func (*MarketHoursQuery) Unique

func (mhq *MarketHoursQuery) Unique(unique bool) *MarketHoursQuery

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 (*MarketHoursQuery) Where

Where adds a new predicate for the MarketHoursQuery builder.

func (*MarketHoursQuery) WithMarketInfo

func (mhq *MarketHoursQuery) WithMarketInfo(opts ...func(*MarketInfoQuery)) *MarketHoursQuery

WithMarketInfo tells the query-builder to eager-load the nodes that are connected to the "market_info" edge. The optional arguments are used to configure the query builder of the edge.

type MarketHoursSelect

type MarketHoursSelect struct {
	*MarketHoursQuery
	// contains filtered or unexported fields
}

MarketHoursSelect is the builder for selecting fields of MarketHours entities.

func (*MarketHoursSelect) Aggregate

func (mhs *MarketHoursSelect) Aggregate(fns ...AggregateFunc) *MarketHoursSelect

Aggregate adds the given aggregation functions to the selector query.

func (*MarketHoursSelect) Bool

func (s *MarketHoursSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MarketHoursSelect) BoolX

func (s *MarketHoursSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MarketHoursSelect) Bools

func (s *MarketHoursSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MarketHoursSelect) BoolsX

func (s *MarketHoursSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MarketHoursSelect) Float64

func (s *MarketHoursSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MarketHoursSelect) Float64X

func (s *MarketHoursSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MarketHoursSelect) Float64s

func (s *MarketHoursSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MarketHoursSelect) Float64sX

func (s *MarketHoursSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MarketHoursSelect) Int

func (s *MarketHoursSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MarketHoursSelect) IntX

func (s *MarketHoursSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MarketHoursSelect) Ints

func (s *MarketHoursSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MarketHoursSelect) IntsX

func (s *MarketHoursSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MarketHoursSelect) Scan

func (mhs *MarketHoursSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*MarketHoursSelect) ScanX

func (s *MarketHoursSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*MarketHoursSelect) String

func (s *MarketHoursSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MarketHoursSelect) StringX

func (s *MarketHoursSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MarketHoursSelect) Strings

func (s *MarketHoursSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MarketHoursSelect) StringsX

func (s *MarketHoursSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MarketHoursSlice

type MarketHoursSlice []*MarketHours

MarketHoursSlice is a parsable slice of MarketHours.

type MarketHoursUpdate

type MarketHoursUpdate struct {
	// contains filtered or unexported fields
}

MarketHoursUpdate is the builder for updating MarketHours entities.

func (*MarketHoursUpdate) ClearMarketInfo

func (mhu *MarketHoursUpdate) ClearMarketInfo() *MarketHoursUpdate

ClearMarketInfo clears the "market_info" edge to the MarketInfo entity.

func (*MarketHoursUpdate) Exec

func (mhu *MarketHoursUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MarketHoursUpdate) ExecX

func (mhu *MarketHoursUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MarketHoursUpdate) Mutation

func (mhu *MarketHoursUpdate) Mutation() *MarketHoursMutation

Mutation returns the MarketHoursMutation object of the builder.

func (*MarketHoursUpdate) Save

func (mhu *MarketHoursUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*MarketHoursUpdate) SaveX

func (mhu *MarketHoursUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*MarketHoursUpdate) SetDate

func (mhu *MarketHoursUpdate) SetDate(t time.Time) *MarketHoursUpdate

SetDate sets the "date" field.

func (*MarketHoursUpdate) SetEndTime

func (mhu *MarketHoursUpdate) SetEndTime(t time.Time) *MarketHoursUpdate

SetEndTime sets the "end_time" field.

func (*MarketHoursUpdate) SetMarketInfo

func (mhu *MarketHoursUpdate) SetMarketInfo(m *MarketInfo) *MarketHoursUpdate

SetMarketInfo sets the "market_info" edge to the MarketInfo entity.

func (*MarketHoursUpdate) SetMarketInfoID

func (mhu *MarketHoursUpdate) SetMarketInfoID(id int) *MarketHoursUpdate

SetMarketInfoID sets the "market_info" edge to the MarketInfo entity by ID.

func (*MarketHoursUpdate) SetNillableMarketInfoID

func (mhu *MarketHoursUpdate) SetNillableMarketInfoID(id *int) *MarketHoursUpdate

SetNillableMarketInfoID sets the "market_info" edge to the MarketInfo entity by ID if the given value is not nil.

func (*MarketHoursUpdate) SetStartTime

func (mhu *MarketHoursUpdate) SetStartTime(t time.Time) *MarketHoursUpdate

SetStartTime sets the "start_time" field.

func (*MarketHoursUpdate) Where

Where appends a list predicates to the MarketHoursUpdate builder.

type MarketHoursUpdateOne

type MarketHoursUpdateOne struct {
	// contains filtered or unexported fields
}

MarketHoursUpdateOne is the builder for updating a single MarketHours entity.

func (*MarketHoursUpdateOne) ClearMarketInfo

func (mhuo *MarketHoursUpdateOne) ClearMarketInfo() *MarketHoursUpdateOne

ClearMarketInfo clears the "market_info" edge to the MarketInfo entity.

func (*MarketHoursUpdateOne) Exec

func (mhuo *MarketHoursUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MarketHoursUpdateOne) ExecX

func (mhuo *MarketHoursUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MarketHoursUpdateOne) Mutation

func (mhuo *MarketHoursUpdateOne) Mutation() *MarketHoursMutation

Mutation returns the MarketHoursMutation object of the builder.

func (*MarketHoursUpdateOne) Save

Save executes the query and returns the updated MarketHours entity.

func (*MarketHoursUpdateOne) SaveX

func (mhuo *MarketHoursUpdateOne) SaveX(ctx context.Context) *MarketHours

SaveX is like Save, but panics if an error occurs.

func (*MarketHoursUpdateOne) Select

func (mhuo *MarketHoursUpdateOne) Select(field string, fields ...string) *MarketHoursUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*MarketHoursUpdateOne) SetDate

SetDate sets the "date" field.

func (*MarketHoursUpdateOne) SetEndTime

func (mhuo *MarketHoursUpdateOne) SetEndTime(t time.Time) *MarketHoursUpdateOne

SetEndTime sets the "end_time" field.

func (*MarketHoursUpdateOne) SetMarketInfo

func (mhuo *MarketHoursUpdateOne) SetMarketInfo(m *MarketInfo) *MarketHoursUpdateOne

SetMarketInfo sets the "market_info" edge to the MarketInfo entity.

func (*MarketHoursUpdateOne) SetMarketInfoID

func (mhuo *MarketHoursUpdateOne) SetMarketInfoID(id int) *MarketHoursUpdateOne

SetMarketInfoID sets the "market_info" edge to the MarketInfo entity by ID.

func (*MarketHoursUpdateOne) SetNillableMarketInfoID

func (mhuo *MarketHoursUpdateOne) SetNillableMarketInfoID(id *int) *MarketHoursUpdateOne

SetNillableMarketInfoID sets the "market_info" edge to the MarketInfo entity by ID if the given value is not nil.

func (*MarketHoursUpdateOne) SetStartTime

func (mhuo *MarketHoursUpdateOne) SetStartTime(t time.Time) *MarketHoursUpdateOne

SetStartTime sets the "start_time" field.

type MarketInfo

type MarketInfo struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// HoursStart holds the value of the "hours_start" field.
	HoursStart time.Time `json:"hours_start,omitempty"`
	// HoursEnd holds the value of the "hours_end" field.
	HoursEnd time.Time `json:"hours_end,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the MarketInfoQuery when eager-loading is set.
	Edges MarketInfoEdges `json:"edges"`
	// contains filtered or unexported fields
}

MarketInfo is the model entity for the MarketInfo schema.

func (*MarketInfo) QueryHours

func (mi *MarketInfo) QueryHours() *MarketHoursQuery

QueryHours queries the "hours" edge of the MarketInfo entity.

func (*MarketInfo) String

func (mi *MarketInfo) String() string

String implements the fmt.Stringer.

func (*MarketInfo) Unwrap

func (mi *MarketInfo) Unwrap() *MarketInfo

Unwrap unwraps the MarketInfo 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 (*MarketInfo) Update

func (mi *MarketInfo) Update() *MarketInfoUpdateOne

Update returns a builder for updating this MarketInfo. Note that you need to call MarketInfo.Unwrap() before calling this method if this MarketInfo was returned from a transaction, and the transaction was committed or rolled back.

type MarketInfoClient

type MarketInfoClient struct {
	// contains filtered or unexported fields
}

MarketInfoClient is a client for the MarketInfo schema.

func NewMarketInfoClient

func NewMarketInfoClient(c config) *MarketInfoClient

NewMarketInfoClient returns a client for the MarketInfo from the given config.

func (*MarketInfoClient) Create

func (c *MarketInfoClient) Create() *MarketInfoCreate

Create returns a builder for creating a MarketInfo entity.

func (*MarketInfoClient) CreateBulk

func (c *MarketInfoClient) CreateBulk(builders ...*MarketInfoCreate) *MarketInfoCreateBulk

CreateBulk returns a builder for creating a bulk of MarketInfo entities.

func (*MarketInfoClient) Delete

func (c *MarketInfoClient) Delete() *MarketInfoDelete

Delete returns a delete builder for MarketInfo.

func (*MarketInfoClient) DeleteOne

func (c *MarketInfoClient) DeleteOne(mi *MarketInfo) *MarketInfoDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*MarketInfoClient) DeleteOneID

func (c *MarketInfoClient) DeleteOneID(id int) *MarketInfoDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*MarketInfoClient) Get

func (c *MarketInfoClient) Get(ctx context.Context, id int) (*MarketInfo, error)

Get returns a MarketInfo entity by its id.

func (*MarketInfoClient) GetX

func (c *MarketInfoClient) GetX(ctx context.Context, id int) *MarketInfo

GetX is like Get, but panics if an error occurs.

func (*MarketInfoClient) Hooks

func (c *MarketInfoClient) Hooks() []Hook

Hooks returns the client hooks.

func (*MarketInfoClient) Intercept

func (c *MarketInfoClient) Intercept(interceptors ...Interceptor)

Use adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `marketinfo.Intercept(f(g(h())))`.

func (*MarketInfoClient) Interceptors

func (c *MarketInfoClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*MarketInfoClient) Query

func (c *MarketInfoClient) Query() *MarketInfoQuery

Query returns a query builder for MarketInfo.

func (*MarketInfoClient) QueryHours

func (c *MarketInfoClient) QueryHours(mi *MarketInfo) *MarketHoursQuery

QueryHours queries the hours edge of a MarketInfo.

func (*MarketInfoClient) Update

func (c *MarketInfoClient) Update() *MarketInfoUpdate

Update returns an update builder for MarketInfo.

func (*MarketInfoClient) UpdateOne

func (c *MarketInfoClient) UpdateOne(mi *MarketInfo) *MarketInfoUpdateOne

UpdateOne returns an update builder for the given entity.

func (*MarketInfoClient) UpdateOneID

func (c *MarketInfoClient) UpdateOneID(id int) *MarketInfoUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MarketInfoClient) Use

func (c *MarketInfoClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `marketinfo.Hooks(f(g(h())))`.

type MarketInfoCreate

type MarketInfoCreate struct {
	// contains filtered or unexported fields
}

MarketInfoCreate is the builder for creating a MarketInfo entity.

func (*MarketInfoCreate) AddHourIDs

func (mic *MarketInfoCreate) AddHourIDs(ids ...int) *MarketInfoCreate

AddHourIDs adds the "hours" edge to the MarketHours entity by IDs.

func (*MarketInfoCreate) AddHours

func (mic *MarketInfoCreate) AddHours(m ...*MarketHours) *MarketInfoCreate

AddHours adds the "hours" edges to the MarketHours entity.

func (*MarketInfoCreate) Exec

func (mic *MarketInfoCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MarketInfoCreate) ExecX

func (mic *MarketInfoCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MarketInfoCreate) Mutation

func (mic *MarketInfoCreate) Mutation() *MarketInfoMutation

Mutation returns the MarketInfoMutation object of the builder.

func (*MarketInfoCreate) Save

func (mic *MarketInfoCreate) Save(ctx context.Context) (*MarketInfo, error)

Save creates the MarketInfo in the database.

func (*MarketInfoCreate) SaveX

func (mic *MarketInfoCreate) SaveX(ctx context.Context) *MarketInfo

SaveX calls Save and panics if Save returns an error.

func (*MarketInfoCreate) SetHoursEnd

func (mic *MarketInfoCreate) SetHoursEnd(t time.Time) *MarketInfoCreate

SetHoursEnd sets the "hours_end" field.

func (*MarketInfoCreate) SetHoursStart

func (mic *MarketInfoCreate) SetHoursStart(t time.Time) *MarketInfoCreate

SetHoursStart sets the "hours_start" field.

type MarketInfoCreateBulk

type MarketInfoCreateBulk struct {
	// contains filtered or unexported fields
}

MarketInfoCreateBulk is the builder for creating many MarketInfo entities in bulk.

func (*MarketInfoCreateBulk) Exec

func (micb *MarketInfoCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*MarketInfoCreateBulk) ExecX

func (micb *MarketInfoCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MarketInfoCreateBulk) Save

func (micb *MarketInfoCreateBulk) Save(ctx context.Context) ([]*MarketInfo, error)

Save creates the MarketInfo entities in the database.

func (*MarketInfoCreateBulk) SaveX

func (micb *MarketInfoCreateBulk) SaveX(ctx context.Context) []*MarketInfo

SaveX is like Save, but panics if an error occurs.

type MarketInfoDelete

type MarketInfoDelete struct {
	// contains filtered or unexported fields
}

MarketInfoDelete is the builder for deleting a MarketInfo entity.

func (*MarketInfoDelete) Exec

func (mid *MarketInfoDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*MarketInfoDelete) ExecX

func (mid *MarketInfoDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*MarketInfoDelete) Where

Where appends a list predicates to the MarketInfoDelete builder.

type MarketInfoDeleteOne

type MarketInfoDeleteOne struct {
	// contains filtered or unexported fields
}

MarketInfoDeleteOne is the builder for deleting a single MarketInfo entity.

func (*MarketInfoDeleteOne) Exec

func (mido *MarketInfoDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MarketInfoDeleteOne) ExecX

func (mido *MarketInfoDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type MarketInfoEdges

type MarketInfoEdges struct {
	// Hours holds the value of the hours edge.
	Hours []*MarketHours `json:"hours,omitempty"`
	// contains filtered or unexported fields
}

MarketInfoEdges holds the relations/edges for other nodes in the graph.

func (MarketInfoEdges) HoursOrErr

func (e MarketInfoEdges) HoursOrErr() ([]*MarketHours, error)

HoursOrErr returns the Hours value or an error if the edge was not loaded in eager-loading.

type MarketInfoGroupBy

type MarketInfoGroupBy struct {
	// contains filtered or unexported fields
}

MarketInfoGroupBy is the group-by builder for MarketInfo entities.

func (*MarketInfoGroupBy) Aggregate

func (migb *MarketInfoGroupBy) Aggregate(fns ...AggregateFunc) *MarketInfoGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*MarketInfoGroupBy) Bool

func (s *MarketInfoGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MarketInfoGroupBy) BoolX

func (s *MarketInfoGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MarketInfoGroupBy) Bools

func (s *MarketInfoGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MarketInfoGroupBy) BoolsX

func (s *MarketInfoGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MarketInfoGroupBy) Float64

func (s *MarketInfoGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MarketInfoGroupBy) Float64X

func (s *MarketInfoGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MarketInfoGroupBy) Float64s

func (s *MarketInfoGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MarketInfoGroupBy) Float64sX

func (s *MarketInfoGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MarketInfoGroupBy) Int

func (s *MarketInfoGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MarketInfoGroupBy) IntX

func (s *MarketInfoGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MarketInfoGroupBy) Ints

func (s *MarketInfoGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MarketInfoGroupBy) IntsX

func (s *MarketInfoGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MarketInfoGroupBy) Scan

func (migb *MarketInfoGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*MarketInfoGroupBy) ScanX

func (s *MarketInfoGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*MarketInfoGroupBy) String

func (s *MarketInfoGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MarketInfoGroupBy) StringX

func (s *MarketInfoGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MarketInfoGroupBy) Strings

func (s *MarketInfoGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MarketInfoGroupBy) StringsX

func (s *MarketInfoGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MarketInfoMutation

type MarketInfoMutation struct {
	// contains filtered or unexported fields
}

MarketInfoMutation represents an operation that mutates the MarketInfo nodes in the graph.

func (*MarketInfoMutation) AddField

func (m *MarketInfoMutation) 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 (*MarketInfoMutation) AddHourIDs

func (m *MarketInfoMutation) AddHourIDs(ids ...int)

AddHourIDs adds the "hours" edge to the MarketHours entity by ids.

func (*MarketInfoMutation) AddedEdges

func (m *MarketInfoMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*MarketInfoMutation) AddedField

func (m *MarketInfoMutation) 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 (*MarketInfoMutation) AddedFields

func (m *MarketInfoMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*MarketInfoMutation) AddedIDs

func (m *MarketInfoMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*MarketInfoMutation) ClearEdge

func (m *MarketInfoMutation) 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 (*MarketInfoMutation) ClearField

func (m *MarketInfoMutation) 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 (*MarketInfoMutation) ClearHours

func (m *MarketInfoMutation) ClearHours()

ClearHours clears the "hours" edge to the MarketHours entity.

func (*MarketInfoMutation) ClearedEdges

func (m *MarketInfoMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*MarketInfoMutation) ClearedFields

func (m *MarketInfoMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (MarketInfoMutation) Client

func (m MarketInfoMutation) 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 (*MarketInfoMutation) EdgeCleared

func (m *MarketInfoMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*MarketInfoMutation) Field

func (m *MarketInfoMutation) 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 (*MarketInfoMutation) FieldCleared

func (m *MarketInfoMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*MarketInfoMutation) Fields

func (m *MarketInfoMutation) 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 (*MarketInfoMutation) HoursCleared

func (m *MarketInfoMutation) HoursCleared() bool

HoursCleared reports if the "hours" edge to the MarketHours entity was cleared.

func (*MarketInfoMutation) HoursEnd

func (m *MarketInfoMutation) HoursEnd() (r time.Time, exists bool)

HoursEnd returns the value of the "hours_end" field in the mutation.

func (*MarketInfoMutation) HoursIDs

func (m *MarketInfoMutation) HoursIDs() (ids []int)

HoursIDs returns the "hours" edge IDs in the mutation.

func (*MarketInfoMutation) HoursStart

func (m *MarketInfoMutation) HoursStart() (r time.Time, exists bool)

HoursStart returns the value of the "hours_start" field in the mutation.

func (*MarketInfoMutation) ID

func (m *MarketInfoMutation) 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 (*MarketInfoMutation) IDs

func (m *MarketInfoMutation) 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 (*MarketInfoMutation) OldField

func (m *MarketInfoMutation) 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 (*MarketInfoMutation) OldHoursEnd

func (m *MarketInfoMutation) OldHoursEnd(ctx context.Context) (v time.Time, err error)

OldHoursEnd returns the old "hours_end" field's value of the MarketInfo entity. If the MarketInfo 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 (*MarketInfoMutation) OldHoursStart

func (m *MarketInfoMutation) OldHoursStart(ctx context.Context) (v time.Time, err error)

OldHoursStart returns the old "hours_start" field's value of the MarketInfo entity. If the MarketInfo 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 (*MarketInfoMutation) Op

func (m *MarketInfoMutation) Op() Op

Op returns the operation name.

func (*MarketInfoMutation) RemoveHourIDs

func (m *MarketInfoMutation) RemoveHourIDs(ids ...int)

RemoveHourIDs removes the "hours" edge to the MarketHours entity by IDs.

func (*MarketInfoMutation) RemovedEdges

func (m *MarketInfoMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*MarketInfoMutation) RemovedHoursIDs

func (m *MarketInfoMutation) RemovedHoursIDs() (ids []int)

RemovedHours returns the removed IDs of the "hours" edge to the MarketHours entity.

func (*MarketInfoMutation) RemovedIDs

func (m *MarketInfoMutation) 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 (*MarketInfoMutation) ResetEdge

func (m *MarketInfoMutation) 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 (*MarketInfoMutation) ResetField

func (m *MarketInfoMutation) 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 (*MarketInfoMutation) ResetHours

func (m *MarketInfoMutation) ResetHours()

ResetHours resets all changes to the "hours" edge.

func (*MarketInfoMutation) ResetHoursEnd

func (m *MarketInfoMutation) ResetHoursEnd()

ResetHoursEnd resets all changes to the "hours_end" field.

func (*MarketInfoMutation) ResetHoursStart

func (m *MarketInfoMutation) ResetHoursStart()

ResetHoursStart resets all changes to the "hours_start" field.

func (*MarketInfoMutation) SetField

func (m *MarketInfoMutation) 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 (*MarketInfoMutation) SetHoursEnd

func (m *MarketInfoMutation) SetHoursEnd(t time.Time)

SetHoursEnd sets the "hours_end" field.

func (*MarketInfoMutation) SetHoursStart

func (m *MarketInfoMutation) SetHoursStart(t time.Time)

SetHoursStart sets the "hours_start" field.

func (*MarketInfoMutation) SetOp

func (m *MarketInfoMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (MarketInfoMutation) Tx

func (m MarketInfoMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*MarketInfoMutation) Type

func (m *MarketInfoMutation) Type() string

Type returns the node type of this mutation (MarketInfo).

func (*MarketInfoMutation) Where

func (m *MarketInfoMutation) Where(ps ...predicate.MarketInfo)

Where appends a list predicates to the MarketInfoMutation builder.

func (*MarketInfoMutation) WhereP

func (m *MarketInfoMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the MarketInfoMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type MarketInfoQuery

type MarketInfoQuery struct {
	// contains filtered or unexported fields
}

MarketInfoQuery is the builder for querying MarketInfo entities.

func (*MarketInfoQuery) Aggregate

func (miq *MarketInfoQuery) Aggregate(fns ...AggregateFunc) *MarketInfoSelect

Aggregate returns a MarketInfoSelect configured with the given aggregations.

func (*MarketInfoQuery) All

func (miq *MarketInfoQuery) All(ctx context.Context) ([]*MarketInfo, error)

All executes the query and returns a list of MarketInfos.

func (*MarketInfoQuery) AllX

func (miq *MarketInfoQuery) AllX(ctx context.Context) []*MarketInfo

AllX is like All, but panics if an error occurs.

func (*MarketInfoQuery) Clone

func (miq *MarketInfoQuery) Clone() *MarketInfoQuery

Clone returns a duplicate of the MarketInfoQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*MarketInfoQuery) Count

func (miq *MarketInfoQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MarketInfoQuery) CountX

func (miq *MarketInfoQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*MarketInfoQuery) Exist

func (miq *MarketInfoQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*MarketInfoQuery) ExistX

func (miq *MarketInfoQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*MarketInfoQuery) First

func (miq *MarketInfoQuery) First(ctx context.Context) (*MarketInfo, error)

First returns the first MarketInfo entity from the query. Returns a *NotFoundError when no MarketInfo was found.

func (*MarketInfoQuery) FirstID

func (miq *MarketInfoQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first MarketInfo ID from the query. Returns a *NotFoundError when no MarketInfo ID was found.

func (*MarketInfoQuery) FirstIDX

func (miq *MarketInfoQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*MarketInfoQuery) FirstX

func (miq *MarketInfoQuery) FirstX(ctx context.Context) *MarketInfo

FirstX is like First, but panics if an error occurs.

func (*MarketInfoQuery) GroupBy

func (miq *MarketInfoQuery) GroupBy(field string, fields ...string) *MarketInfoGroupBy

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 {
	HoursStart time.Time `json:"hours_start,omitempty"`
	Count int `json:"count,omitempty"`
}

client.MarketInfo.Query().
	GroupBy(marketinfo.FieldHoursStart).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MarketInfoQuery) IDs

func (miq *MarketInfoQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of MarketInfo IDs.

func (*MarketInfoQuery) IDsX

func (miq *MarketInfoQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*MarketInfoQuery) Limit

func (miq *MarketInfoQuery) Limit(limit int) *MarketInfoQuery

Limit the number of records to be returned by this query.

func (*MarketInfoQuery) Offset

func (miq *MarketInfoQuery) Offset(offset int) *MarketInfoQuery

Offset to start from.

func (*MarketInfoQuery) Only

func (miq *MarketInfoQuery) Only(ctx context.Context) (*MarketInfo, error)

Only returns a single MarketInfo entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one MarketInfo entity is found. Returns a *NotFoundError when no MarketInfo entities are found.

func (*MarketInfoQuery) OnlyID

func (miq *MarketInfoQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only MarketInfo ID in the query. Returns a *NotSingularError when more than one MarketInfo ID is found. Returns a *NotFoundError when no entities are found.

func (*MarketInfoQuery) OnlyIDX

func (miq *MarketInfoQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*MarketInfoQuery) OnlyX

func (miq *MarketInfoQuery) OnlyX(ctx context.Context) *MarketInfo

OnlyX is like Only, but panics if an error occurs.

func (*MarketInfoQuery) Order

func (miq *MarketInfoQuery) Order(o ...OrderFunc) *MarketInfoQuery

Order specifies how the records should be ordered.

func (*MarketInfoQuery) QueryHours

func (miq *MarketInfoQuery) QueryHours() *MarketHoursQuery

QueryHours chains the current query on the "hours" edge.

func (*MarketInfoQuery) Select

func (miq *MarketInfoQuery) Select(fields ...string) *MarketInfoSelect

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 {
	HoursStart time.Time `json:"hours_start,omitempty"`
}

client.MarketInfo.Query().
	Select(marketinfo.FieldHoursStart).
	Scan(ctx, &v)

func (*MarketInfoQuery) Unique

func (miq *MarketInfoQuery) Unique(unique bool) *MarketInfoQuery

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 (*MarketInfoQuery) Where

Where adds a new predicate for the MarketInfoQuery builder.

func (*MarketInfoQuery) WithHours

func (miq *MarketInfoQuery) WithHours(opts ...func(*MarketHoursQuery)) *MarketInfoQuery

WithHours tells the query-builder to eager-load the nodes that are connected to the "hours" edge. The optional arguments are used to configure the query builder of the edge.

type MarketInfoSelect

type MarketInfoSelect struct {
	*MarketInfoQuery
	// contains filtered or unexported fields
}

MarketInfoSelect is the builder for selecting fields of MarketInfo entities.

func (*MarketInfoSelect) Aggregate

func (mis *MarketInfoSelect) Aggregate(fns ...AggregateFunc) *MarketInfoSelect

Aggregate adds the given aggregation functions to the selector query.

func (*MarketInfoSelect) Bool

func (s *MarketInfoSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*MarketInfoSelect) BoolX

func (s *MarketInfoSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*MarketInfoSelect) Bools

func (s *MarketInfoSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*MarketInfoSelect) BoolsX

func (s *MarketInfoSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*MarketInfoSelect) Float64

func (s *MarketInfoSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*MarketInfoSelect) Float64X

func (s *MarketInfoSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*MarketInfoSelect) Float64s

func (s *MarketInfoSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*MarketInfoSelect) Float64sX

func (s *MarketInfoSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*MarketInfoSelect) Int

func (s *MarketInfoSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*MarketInfoSelect) IntX

func (s *MarketInfoSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*MarketInfoSelect) Ints

func (s *MarketInfoSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*MarketInfoSelect) IntsX

func (s *MarketInfoSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*MarketInfoSelect) Scan

func (mis *MarketInfoSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*MarketInfoSelect) ScanX

func (s *MarketInfoSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*MarketInfoSelect) String

func (s *MarketInfoSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*MarketInfoSelect) StringX

func (s *MarketInfoSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*MarketInfoSelect) Strings

func (s *MarketInfoSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*MarketInfoSelect) StringsX

func (s *MarketInfoSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type MarketInfoUpdate

type MarketInfoUpdate struct {
	// contains filtered or unexported fields
}

MarketInfoUpdate is the builder for updating MarketInfo entities.

func (*MarketInfoUpdate) AddHourIDs

func (miu *MarketInfoUpdate) AddHourIDs(ids ...int) *MarketInfoUpdate

AddHourIDs adds the "hours" edge to the MarketHours entity by IDs.

func (*MarketInfoUpdate) AddHours

func (miu *MarketInfoUpdate) AddHours(m ...*MarketHours) *MarketInfoUpdate

AddHours adds the "hours" edges to the MarketHours entity.

func (*MarketInfoUpdate) ClearHours

func (miu *MarketInfoUpdate) ClearHours() *MarketInfoUpdate

ClearHours clears all "hours" edges to the MarketHours entity.

func (*MarketInfoUpdate) Exec

func (miu *MarketInfoUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MarketInfoUpdate) ExecX

func (miu *MarketInfoUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MarketInfoUpdate) Mutation

func (miu *MarketInfoUpdate) Mutation() *MarketInfoMutation

Mutation returns the MarketInfoMutation object of the builder.

func (*MarketInfoUpdate) RemoveHourIDs

func (miu *MarketInfoUpdate) RemoveHourIDs(ids ...int) *MarketInfoUpdate

RemoveHourIDs removes the "hours" edge to MarketHours entities by IDs.

func (*MarketInfoUpdate) RemoveHours

func (miu *MarketInfoUpdate) RemoveHours(m ...*MarketHours) *MarketInfoUpdate

RemoveHours removes "hours" edges to MarketHours entities.

func (*MarketInfoUpdate) Save

func (miu *MarketInfoUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*MarketInfoUpdate) SaveX

func (miu *MarketInfoUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*MarketInfoUpdate) SetHoursEnd

func (miu *MarketInfoUpdate) SetHoursEnd(t time.Time) *MarketInfoUpdate

SetHoursEnd sets the "hours_end" field.

func (*MarketInfoUpdate) SetHoursStart

func (miu *MarketInfoUpdate) SetHoursStart(t time.Time) *MarketInfoUpdate

SetHoursStart sets the "hours_start" field.

func (*MarketInfoUpdate) Where

Where appends a list predicates to the MarketInfoUpdate builder.

type MarketInfoUpdateOne

type MarketInfoUpdateOne struct {
	// contains filtered or unexported fields
}

MarketInfoUpdateOne is the builder for updating a single MarketInfo entity.

func (*MarketInfoUpdateOne) AddHourIDs

func (miuo *MarketInfoUpdateOne) AddHourIDs(ids ...int) *MarketInfoUpdateOne

AddHourIDs adds the "hours" edge to the MarketHours entity by IDs.

func (*MarketInfoUpdateOne) AddHours

func (miuo *MarketInfoUpdateOne) AddHours(m ...*MarketHours) *MarketInfoUpdateOne

AddHours adds the "hours" edges to the MarketHours entity.

func (*MarketInfoUpdateOne) ClearHours

func (miuo *MarketInfoUpdateOne) ClearHours() *MarketInfoUpdateOne

ClearHours clears all "hours" edges to the MarketHours entity.

func (*MarketInfoUpdateOne) Exec

func (miuo *MarketInfoUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MarketInfoUpdateOne) ExecX

func (miuo *MarketInfoUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*MarketInfoUpdateOne) Mutation

func (miuo *MarketInfoUpdateOne) Mutation() *MarketInfoMutation

Mutation returns the MarketInfoMutation object of the builder.

func (*MarketInfoUpdateOne) RemoveHourIDs

func (miuo *MarketInfoUpdateOne) RemoveHourIDs(ids ...int) *MarketInfoUpdateOne

RemoveHourIDs removes the "hours" edge to MarketHours entities by IDs.

func (*MarketInfoUpdateOne) RemoveHours

func (miuo *MarketInfoUpdateOne) RemoveHours(m ...*MarketHours) *MarketInfoUpdateOne

RemoveHours removes "hours" edges to MarketHours entities.

func (*MarketInfoUpdateOne) Save

func (miuo *MarketInfoUpdateOne) Save(ctx context.Context) (*MarketInfo, error)

Save executes the query and returns the updated MarketInfo entity.

func (*MarketInfoUpdateOne) SaveX

func (miuo *MarketInfoUpdateOne) SaveX(ctx context.Context) *MarketInfo

SaveX is like Save, but panics if an error occurs.

func (*MarketInfoUpdateOne) Select

func (miuo *MarketInfoUpdateOne) Select(field string, fields ...string) *MarketInfoUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*MarketInfoUpdateOne) SetHoursEnd

func (miuo *MarketInfoUpdateOne) SetHoursEnd(t time.Time) *MarketInfoUpdateOne

SetHoursEnd sets the "hours_end" field.

func (*MarketInfoUpdateOne) SetHoursStart

func (miuo *MarketInfoUpdateOne) SetHoursStart(t time.Time) *MarketInfoUpdateOne

SetHoursStart sets the "hours_start" field.

type MarketInfos

type MarketInfos []*MarketInfo

MarketInfos is a parsable slice of MarketInfo.

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.

func Asc

func Asc(fields ...string) OrderFunc

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) OrderFunc

Desc applies the given fields in DESC order.

type 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 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 Split

type Split struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// ExecutionDate holds the value of the "execution_date" field.
	ExecutionDate time.Time `json:"execution_date,omitempty"`
	// From holds the value of the "from" field.
	From float64 `json:"from,omitempty"`
	// To holds the value of the "to" field.
	To float64 `json:"to,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the SplitQuery when eager-loading is set.
	Edges SplitEdges `json:"edges"`
	// contains filtered or unexported fields
}

Split is the model entity for the Split schema.

func (*Split) QueryStock

func (s *Split) QueryStock() *EntityQuery

QueryStock queries the "stock" edge of the Split entity.

func (*Split) String

func (s *Split) String() string

String implements the fmt.Stringer.

func (*Split) Unwrap

func (s *Split) Unwrap() *Split

Unwrap unwraps the Split 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 (*Split) Update

func (s *Split) Update() *SplitUpdateOne

Update returns a builder for updating this Split. Note that you need to call Split.Unwrap() before calling this method if this Split was returned from a transaction, and the transaction was committed or rolled back.

type SplitClient

type SplitClient struct {
	// contains filtered or unexported fields
}

SplitClient is a client for the Split schema.

func NewSplitClient

func NewSplitClient(c config) *SplitClient

NewSplitClient returns a client for the Split from the given config.

func (*SplitClient) Create

func (c *SplitClient) Create() *SplitCreate

Create returns a builder for creating a Split entity.

func (*SplitClient) CreateBulk

func (c *SplitClient) CreateBulk(builders ...*SplitCreate) *SplitCreateBulk

CreateBulk returns a builder for creating a bulk of Split entities.

func (*SplitClient) Delete

func (c *SplitClient) Delete() *SplitDelete

Delete returns a delete builder for Split.

func (*SplitClient) DeleteOne

func (c *SplitClient) DeleteOne(s *Split) *SplitDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SplitClient) DeleteOneID

func (c *SplitClient) DeleteOneID(id int) *SplitDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*SplitClient) Get

func (c *SplitClient) Get(ctx context.Context, id int) (*Split, error)

Get returns a Split entity by its id.

func (*SplitClient) GetX

func (c *SplitClient) GetX(ctx context.Context, id int) *Split

GetX is like Get, but panics if an error occurs.

func (*SplitClient) Hooks

func (c *SplitClient) Hooks() []Hook

Hooks returns the client hooks.

func (*SplitClient) Intercept

func (c *SplitClient) Intercept(interceptors ...Interceptor)

Use adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `split.Intercept(f(g(h())))`.

func (*SplitClient) Interceptors

func (c *SplitClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*SplitClient) Query

func (c *SplitClient) Query() *SplitQuery

Query returns a query builder for Split.

func (*SplitClient) QueryStock

func (c *SplitClient) QueryStock(s *Split) *EntityQuery

QueryStock queries the stock edge of a Split.

func (*SplitClient) Update

func (c *SplitClient) Update() *SplitUpdate

Update returns an update builder for Split.

func (*SplitClient) UpdateOne

func (c *SplitClient) UpdateOne(s *Split) *SplitUpdateOne

UpdateOne returns an update builder for the given entity.

func (*SplitClient) UpdateOneID

func (c *SplitClient) UpdateOneID(id int) *SplitUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SplitClient) Use

func (c *SplitClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `split.Hooks(f(g(h())))`.

type SplitCreate

type SplitCreate struct {
	// contains filtered or unexported fields
}

SplitCreate is the builder for creating a Split entity.

func (*SplitCreate) Exec

func (sc *SplitCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SplitCreate) ExecX

func (sc *SplitCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SplitCreate) Mutation

func (sc *SplitCreate) Mutation() *SplitMutation

Mutation returns the SplitMutation object of the builder.

func (*SplitCreate) Save

func (sc *SplitCreate) Save(ctx context.Context) (*Split, error)

Save creates the Split in the database.

func (*SplitCreate) SaveX

func (sc *SplitCreate) SaveX(ctx context.Context) *Split

SaveX calls Save and panics if Save returns an error.

func (*SplitCreate) SetExecutionDate

func (sc *SplitCreate) SetExecutionDate(t time.Time) *SplitCreate

SetExecutionDate sets the "execution_date" field.

func (*SplitCreate) SetFrom

func (sc *SplitCreate) SetFrom(f float64) *SplitCreate

SetFrom sets the "from" field.

func (*SplitCreate) SetNillableStockID

func (sc *SplitCreate) SetNillableStockID(id *int) *SplitCreate

SetNillableStockID sets the "stock" edge to the Entity entity by ID if the given value is not nil.

func (*SplitCreate) SetStock

func (sc *SplitCreate) SetStock(e *Entity) *SplitCreate

SetStock sets the "stock" edge to the Entity entity.

func (*SplitCreate) SetStockID

func (sc *SplitCreate) SetStockID(id int) *SplitCreate

SetStockID sets the "stock" edge to the Entity entity by ID.

func (*SplitCreate) SetTo

func (sc *SplitCreate) SetTo(f float64) *SplitCreate

SetTo sets the "to" field.

type SplitCreateBulk

type SplitCreateBulk struct {
	// contains filtered or unexported fields
}

SplitCreateBulk is the builder for creating many Split entities in bulk.

func (*SplitCreateBulk) Exec

func (scb *SplitCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SplitCreateBulk) ExecX

func (scb *SplitCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SplitCreateBulk) Save

func (scb *SplitCreateBulk) Save(ctx context.Context) ([]*Split, error)

Save creates the Split entities in the database.

func (*SplitCreateBulk) SaveX

func (scb *SplitCreateBulk) SaveX(ctx context.Context) []*Split

SaveX is like Save, but panics if an error occurs.

type SplitDelete

type SplitDelete struct {
	// contains filtered or unexported fields
}

SplitDelete is the builder for deleting a Split entity.

func (*SplitDelete) Exec

func (sd *SplitDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*SplitDelete) ExecX

func (sd *SplitDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*SplitDelete) Where

func (sd *SplitDelete) Where(ps ...predicate.Split) *SplitDelete

Where appends a list predicates to the SplitDelete builder.

type SplitDeleteOne

type SplitDeleteOne struct {
	// contains filtered or unexported fields
}

SplitDeleteOne is the builder for deleting a single Split entity.

func (*SplitDeleteOne) Exec

func (sdo *SplitDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SplitDeleteOne) ExecX

func (sdo *SplitDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type SplitEdges

type SplitEdges struct {
	// Stock holds the value of the stock edge.
	Stock *Entity `json:"stock,omitempty"`
	// contains filtered or unexported fields
}

SplitEdges holds the relations/edges for other nodes in the graph.

func (SplitEdges) StockOrErr

func (e SplitEdges) StockOrErr() (*Entity, error)

StockOrErr returns the Stock value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type SplitGroupBy

type SplitGroupBy struct {
	// contains filtered or unexported fields
}

SplitGroupBy is the group-by builder for Split entities.

func (*SplitGroupBy) Aggregate

func (sgb *SplitGroupBy) Aggregate(fns ...AggregateFunc) *SplitGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*SplitGroupBy) Bool

func (s *SplitGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SplitGroupBy) BoolX

func (s *SplitGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SplitGroupBy) Bools

func (s *SplitGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SplitGroupBy) BoolsX

func (s *SplitGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SplitGroupBy) Float64

func (s *SplitGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SplitGroupBy) Float64X

func (s *SplitGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SplitGroupBy) Float64s

func (s *SplitGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SplitGroupBy) Float64sX

func (s *SplitGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SplitGroupBy) Int

func (s *SplitGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SplitGroupBy) IntX

func (s *SplitGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SplitGroupBy) Ints

func (s *SplitGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SplitGroupBy) IntsX

func (s *SplitGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SplitGroupBy) Scan

func (sgb *SplitGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SplitGroupBy) ScanX

func (s *SplitGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SplitGroupBy) String

func (s *SplitGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SplitGroupBy) StringX

func (s *SplitGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SplitGroupBy) Strings

func (s *SplitGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SplitGroupBy) StringsX

func (s *SplitGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SplitMutation

type SplitMutation struct {
	// contains filtered or unexported fields
}

SplitMutation represents an operation that mutates the Split nodes in the graph.

func (*SplitMutation) AddField

func (m *SplitMutation) 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 (*SplitMutation) AddFrom

func (m *SplitMutation) AddFrom(f float64)

AddFrom adds f to the "from" field.

func (*SplitMutation) AddTo

func (m *SplitMutation) AddTo(f float64)

AddTo adds f to the "to" field.

func (*SplitMutation) AddedEdges

func (m *SplitMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*SplitMutation) AddedField

func (m *SplitMutation) 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 (*SplitMutation) AddedFields

func (m *SplitMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*SplitMutation) AddedFrom

func (m *SplitMutation) AddedFrom() (r float64, exists bool)

AddedFrom returns the value that was added to the "from" field in this mutation.

func (*SplitMutation) AddedIDs

func (m *SplitMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*SplitMutation) AddedTo

func (m *SplitMutation) AddedTo() (r float64, exists bool)

AddedTo returns the value that was added to the "to" field in this mutation.

func (*SplitMutation) ClearEdge

func (m *SplitMutation) 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 (*SplitMutation) ClearField

func (m *SplitMutation) 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 (*SplitMutation) ClearStock

func (m *SplitMutation) ClearStock()

ClearStock clears the "stock" edge to the Entity entity.

func (*SplitMutation) ClearedEdges

func (m *SplitMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*SplitMutation) ClearedFields

func (m *SplitMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (SplitMutation) Client

func (m SplitMutation) 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 (*SplitMutation) EdgeCleared

func (m *SplitMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*SplitMutation) ExecutionDate

func (m *SplitMutation) ExecutionDate() (r time.Time, exists bool)

ExecutionDate returns the value of the "execution_date" field in the mutation.

func (*SplitMutation) Field

func (m *SplitMutation) 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 (*SplitMutation) FieldCleared

func (m *SplitMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*SplitMutation) Fields

func (m *SplitMutation) 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 (*SplitMutation) From

func (m *SplitMutation) From() (r float64, exists bool)

From returns the value of the "from" field in the mutation.

func (*SplitMutation) ID

func (m *SplitMutation) 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 (*SplitMutation) IDs

func (m *SplitMutation) 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 (*SplitMutation) OldExecutionDate

func (m *SplitMutation) OldExecutionDate(ctx context.Context) (v time.Time, err error)

OldExecutionDate returns the old "execution_date" field's value of the Split entity. If the Split 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 (*SplitMutation) OldField

func (m *SplitMutation) 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 (*SplitMutation) OldFrom

func (m *SplitMutation) OldFrom(ctx context.Context) (v float64, err error)

OldFrom returns the old "from" field's value of the Split entity. If the Split 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 (*SplitMutation) OldTo

func (m *SplitMutation) OldTo(ctx context.Context) (v float64, err error)

OldTo returns the old "to" field's value of the Split entity. If the Split 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 (*SplitMutation) Op

func (m *SplitMutation) Op() Op

Op returns the operation name.

func (*SplitMutation) RemovedEdges

func (m *SplitMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*SplitMutation) RemovedIDs

func (m *SplitMutation) 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 (*SplitMutation) ResetEdge

func (m *SplitMutation) 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 (*SplitMutation) ResetExecutionDate

func (m *SplitMutation) ResetExecutionDate()

ResetExecutionDate resets all changes to the "execution_date" field.

func (*SplitMutation) ResetField

func (m *SplitMutation) 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 (*SplitMutation) ResetFrom

func (m *SplitMutation) ResetFrom()

ResetFrom resets all changes to the "from" field.

func (*SplitMutation) ResetStock

func (m *SplitMutation) ResetStock()

ResetStock resets all changes to the "stock" edge.

func (*SplitMutation) ResetTo

func (m *SplitMutation) ResetTo()

ResetTo resets all changes to the "to" field.

func (*SplitMutation) SetExecutionDate

func (m *SplitMutation) SetExecutionDate(t time.Time)

SetExecutionDate sets the "execution_date" field.

func (*SplitMutation) SetField

func (m *SplitMutation) 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 (*SplitMutation) SetFrom

func (m *SplitMutation) SetFrom(f float64)

SetFrom sets the "from" field.

func (*SplitMutation) SetOp

func (m *SplitMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*SplitMutation) SetStockID

func (m *SplitMutation) SetStockID(id int)

SetStockID sets the "stock" edge to the Entity entity by id.

func (*SplitMutation) SetTo

func (m *SplitMutation) SetTo(f float64)

SetTo sets the "to" field.

func (*SplitMutation) StockCleared

func (m *SplitMutation) StockCleared() bool

StockCleared reports if the "stock" edge to the Entity entity was cleared.

func (*SplitMutation) StockID

func (m *SplitMutation) StockID() (id int, exists bool)

StockID returns the "stock" edge ID in the mutation.

func (*SplitMutation) StockIDs

func (m *SplitMutation) StockIDs() (ids []int)

StockIDs returns the "stock" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use StockID instead. It exists only for internal usage by the builders.

func (*SplitMutation) To

func (m *SplitMutation) To() (r float64, exists bool)

To returns the value of the "to" field in the mutation.

func (SplitMutation) Tx

func (m SplitMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*SplitMutation) Type

func (m *SplitMutation) Type() string

Type returns the node type of this mutation (Split).

func (*SplitMutation) Where

func (m *SplitMutation) Where(ps ...predicate.Split)

Where appends a list predicates to the SplitMutation builder.

func (*SplitMutation) WhereP

func (m *SplitMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the SplitMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type SplitQuery

type SplitQuery struct {
	// contains filtered or unexported fields
}

SplitQuery is the builder for querying Split entities.

func (*SplitQuery) Aggregate

func (sq *SplitQuery) Aggregate(fns ...AggregateFunc) *SplitSelect

Aggregate returns a SplitSelect configured with the given aggregations.

func (*SplitQuery) All

func (sq *SplitQuery) All(ctx context.Context) ([]*Split, error)

All executes the query and returns a list of Splits.

func (*SplitQuery) AllX

func (sq *SplitQuery) AllX(ctx context.Context) []*Split

AllX is like All, but panics if an error occurs.

func (*SplitQuery) Clone

func (sq *SplitQuery) Clone() *SplitQuery

Clone returns a duplicate of the SplitQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*SplitQuery) Count

func (sq *SplitQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SplitQuery) CountX

func (sq *SplitQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*SplitQuery) Exist

func (sq *SplitQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*SplitQuery) ExistX

func (sq *SplitQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*SplitQuery) First

func (sq *SplitQuery) First(ctx context.Context) (*Split, error)

First returns the first Split entity from the query. Returns a *NotFoundError when no Split was found.

func (*SplitQuery) FirstID

func (sq *SplitQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Split ID from the query. Returns a *NotFoundError when no Split ID was found.

func (*SplitQuery) FirstIDX

func (sq *SplitQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*SplitQuery) FirstX

func (sq *SplitQuery) FirstX(ctx context.Context) *Split

FirstX is like First, but panics if an error occurs.

func (*SplitQuery) GroupBy

func (sq *SplitQuery) GroupBy(field string, fields ...string) *SplitGroupBy

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 {
	ExecutionDate time.Time `json:"execution_date,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Split.Query().
	GroupBy(split.FieldExecutionDate).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SplitQuery) IDs

func (sq *SplitQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of Split IDs.

func (*SplitQuery) IDsX

func (sq *SplitQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*SplitQuery) Limit

func (sq *SplitQuery) Limit(limit int) *SplitQuery

Limit the number of records to be returned by this query.

func (*SplitQuery) Offset

func (sq *SplitQuery) Offset(offset int) *SplitQuery

Offset to start from.

func (*SplitQuery) Only

func (sq *SplitQuery) Only(ctx context.Context) (*Split, error)

Only returns a single Split entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Split entity is found. Returns a *NotFoundError when no Split entities are found.

func (*SplitQuery) OnlyID

func (sq *SplitQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Split ID in the query. Returns a *NotSingularError when more than one Split ID is found. Returns a *NotFoundError when no entities are found.

func (*SplitQuery) OnlyIDX

func (sq *SplitQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*SplitQuery) OnlyX

func (sq *SplitQuery) OnlyX(ctx context.Context) *Split

OnlyX is like Only, but panics if an error occurs.

func (*SplitQuery) Order

func (sq *SplitQuery) Order(o ...OrderFunc) *SplitQuery

Order specifies how the records should be ordered.

func (*SplitQuery) QueryStock

func (sq *SplitQuery) QueryStock() *EntityQuery

QueryStock chains the current query on the "stock" edge.

func (*SplitQuery) Select

func (sq *SplitQuery) Select(fields ...string) *SplitSelect

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 {
	ExecutionDate time.Time `json:"execution_date,omitempty"`
}

client.Split.Query().
	Select(split.FieldExecutionDate).
	Scan(ctx, &v)

func (*SplitQuery) Unique

func (sq *SplitQuery) Unique(unique bool) *SplitQuery

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 (*SplitQuery) Where

func (sq *SplitQuery) Where(ps ...predicate.Split) *SplitQuery

Where adds a new predicate for the SplitQuery builder.

func (*SplitQuery) WithStock

func (sq *SplitQuery) WithStock(opts ...func(*EntityQuery)) *SplitQuery

WithStock tells the query-builder to eager-load the nodes that are connected to the "stock" edge. The optional arguments are used to configure the query builder of the edge.

type SplitSelect

type SplitSelect struct {
	*SplitQuery
	// contains filtered or unexported fields
}

SplitSelect is the builder for selecting fields of Split entities.

func (*SplitSelect) Aggregate

func (ss *SplitSelect) Aggregate(fns ...AggregateFunc) *SplitSelect

Aggregate adds the given aggregation functions to the selector query.

func (*SplitSelect) Bool

func (s *SplitSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*SplitSelect) BoolX

func (s *SplitSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*SplitSelect) Bools

func (s *SplitSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*SplitSelect) BoolsX

func (s *SplitSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*SplitSelect) Float64

func (s *SplitSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*SplitSelect) Float64X

func (s *SplitSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*SplitSelect) Float64s

func (s *SplitSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*SplitSelect) Float64sX

func (s *SplitSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*SplitSelect) Int

func (s *SplitSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*SplitSelect) IntX

func (s *SplitSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*SplitSelect) Ints

func (s *SplitSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*SplitSelect) IntsX

func (s *SplitSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*SplitSelect) Scan

func (ss *SplitSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*SplitSelect) ScanX

func (s *SplitSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*SplitSelect) String

func (s *SplitSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*SplitSelect) StringX

func (s *SplitSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*SplitSelect) Strings

func (s *SplitSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*SplitSelect) StringsX

func (s *SplitSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type SplitUpdate

type SplitUpdate struct {
	// contains filtered or unexported fields
}

SplitUpdate is the builder for updating Split entities.

func (*SplitUpdate) AddFrom

func (su *SplitUpdate) AddFrom(f float64) *SplitUpdate

AddFrom adds f to the "from" field.

func (*SplitUpdate) AddTo

func (su *SplitUpdate) AddTo(f float64) *SplitUpdate

AddTo adds f to the "to" field.

func (*SplitUpdate) ClearStock

func (su *SplitUpdate) ClearStock() *SplitUpdate

ClearStock clears the "stock" edge to the Entity entity.

func (*SplitUpdate) Exec

func (su *SplitUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SplitUpdate) ExecX

func (su *SplitUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SplitUpdate) Mutation

func (su *SplitUpdate) Mutation() *SplitMutation

Mutation returns the SplitMutation object of the builder.

func (*SplitUpdate) Save

func (su *SplitUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*SplitUpdate) SaveX

func (su *SplitUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*SplitUpdate) SetExecutionDate

func (su *SplitUpdate) SetExecutionDate(t time.Time) *SplitUpdate

SetExecutionDate sets the "execution_date" field.

func (*SplitUpdate) SetFrom

func (su *SplitUpdate) SetFrom(f float64) *SplitUpdate

SetFrom sets the "from" field.

func (*SplitUpdate) SetNillableStockID

func (su *SplitUpdate) SetNillableStockID(id *int) *SplitUpdate

SetNillableStockID sets the "stock" edge to the Entity entity by ID if the given value is not nil.

func (*SplitUpdate) SetStock

func (su *SplitUpdate) SetStock(e *Entity) *SplitUpdate

SetStock sets the "stock" edge to the Entity entity.

func (*SplitUpdate) SetStockID

func (su *SplitUpdate) SetStockID(id int) *SplitUpdate

SetStockID sets the "stock" edge to the Entity entity by ID.

func (*SplitUpdate) SetTo

func (su *SplitUpdate) SetTo(f float64) *SplitUpdate

SetTo sets the "to" field.

func (*SplitUpdate) Where

func (su *SplitUpdate) Where(ps ...predicate.Split) *SplitUpdate

Where appends a list predicates to the SplitUpdate builder.

type SplitUpdateOne

type SplitUpdateOne struct {
	// contains filtered or unexported fields
}

SplitUpdateOne is the builder for updating a single Split entity.

func (*SplitUpdateOne) AddFrom

func (suo *SplitUpdateOne) AddFrom(f float64) *SplitUpdateOne

AddFrom adds f to the "from" field.

func (*SplitUpdateOne) AddTo

func (suo *SplitUpdateOne) AddTo(f float64) *SplitUpdateOne

AddTo adds f to the "to" field.

func (*SplitUpdateOne) ClearStock

func (suo *SplitUpdateOne) ClearStock() *SplitUpdateOne

ClearStock clears the "stock" edge to the Entity entity.

func (*SplitUpdateOne) Exec

func (suo *SplitUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SplitUpdateOne) ExecX

func (suo *SplitUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*SplitUpdateOne) Mutation

func (suo *SplitUpdateOne) Mutation() *SplitMutation

Mutation returns the SplitMutation object of the builder.

func (*SplitUpdateOne) Save

func (suo *SplitUpdateOne) Save(ctx context.Context) (*Split, error)

Save executes the query and returns the updated Split entity.

func (*SplitUpdateOne) SaveX

func (suo *SplitUpdateOne) SaveX(ctx context.Context) *Split

SaveX is like Save, but panics if an error occurs.

func (*SplitUpdateOne) Select

func (suo *SplitUpdateOne) Select(field string, fields ...string) *SplitUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*SplitUpdateOne) SetExecutionDate

func (suo *SplitUpdateOne) SetExecutionDate(t time.Time) *SplitUpdateOne

SetExecutionDate sets the "execution_date" field.

func (*SplitUpdateOne) SetFrom

func (suo *SplitUpdateOne) SetFrom(f float64) *SplitUpdateOne

SetFrom sets the "from" field.

func (*SplitUpdateOne) SetNillableStockID

func (suo *SplitUpdateOne) SetNillableStockID(id *int) *SplitUpdateOne

SetNillableStockID sets the "stock" edge to the Entity entity by ID if the given value is not nil.

func (*SplitUpdateOne) SetStock

func (suo *SplitUpdateOne) SetStock(e *Entity) *SplitUpdateOne

SetStock sets the "stock" edge to the Entity entity.

func (*SplitUpdateOne) SetStockID

func (suo *SplitUpdateOne) SetStockID(id int) *SplitUpdateOne

SetStockID sets the "stock" edge to the Entity entity by ID.

func (*SplitUpdateOne) SetTo

func (suo *SplitUpdateOne) SetTo(f float64) *SplitUpdateOne

SetTo sets the "to" field.

type Splits

type Splits []*Split

Splits is a parsable slice of Split.

type TradeCondition

type TradeCondition struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Condition holds the value of the "condition" field.
	Condition string `json:"condition,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TradeConditionQuery when eager-loading is set.
	Edges TradeConditionEdges `json:"edges"`
	// contains filtered or unexported fields
}

TradeCondition is the model entity for the TradeCondition schema.

func (*TradeCondition) QueryRecord

func (tc *TradeCondition) QueryRecord() *TradeRecordQuery

QueryRecord queries the "record" edge of the TradeCondition entity.

func (*TradeCondition) String

func (tc *TradeCondition) String() string

String implements the fmt.Stringer.

func (*TradeCondition) Unwrap

func (tc *TradeCondition) Unwrap() *TradeCondition

Unwrap unwraps the TradeCondition 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 (*TradeCondition) Update

Update returns a builder for updating this TradeCondition. Note that you need to call TradeCondition.Unwrap() before calling this method if this TradeCondition was returned from a transaction, and the transaction was committed or rolled back.

type TradeConditionClient

type TradeConditionClient struct {
	// contains filtered or unexported fields
}

TradeConditionClient is a client for the TradeCondition schema.

func NewTradeConditionClient

func NewTradeConditionClient(c config) *TradeConditionClient

NewTradeConditionClient returns a client for the TradeCondition from the given config.

func (*TradeConditionClient) Create

Create returns a builder for creating a TradeCondition entity.

func (*TradeConditionClient) CreateBulk

CreateBulk returns a builder for creating a bulk of TradeCondition entities.

func (*TradeConditionClient) Delete

Delete returns a delete builder for TradeCondition.

func (*TradeConditionClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TradeConditionClient) DeleteOneID

func (c *TradeConditionClient) DeleteOneID(id int) *TradeConditionDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*TradeConditionClient) Get

Get returns a TradeCondition entity by its id.

func (*TradeConditionClient) GetX

GetX is like Get, but panics if an error occurs.

func (*TradeConditionClient) Hooks

func (c *TradeConditionClient) Hooks() []Hook

Hooks returns the client hooks.

func (*TradeConditionClient) Intercept

func (c *TradeConditionClient) Intercept(interceptors ...Interceptor)

Use adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `tradecondition.Intercept(f(g(h())))`.

func (*TradeConditionClient) Interceptors

func (c *TradeConditionClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*TradeConditionClient) Query

Query returns a query builder for TradeCondition.

func (*TradeConditionClient) QueryRecord

QueryRecord queries the record edge of a TradeCondition.

func (*TradeConditionClient) Update

Update returns an update builder for TradeCondition.

func (*TradeConditionClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*TradeConditionClient) UpdateOneID

func (c *TradeConditionClient) UpdateOneID(id int) *TradeConditionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TradeConditionClient) Use

func (c *TradeConditionClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `tradecondition.Hooks(f(g(h())))`.

type TradeConditionCreate

type TradeConditionCreate struct {
	// contains filtered or unexported fields
}

TradeConditionCreate is the builder for creating a TradeCondition entity.

func (*TradeConditionCreate) AddRecord

func (tcc *TradeConditionCreate) AddRecord(t ...*TradeRecord) *TradeConditionCreate

AddRecord adds the "record" edges to the TradeRecord entity.

func (*TradeConditionCreate) AddRecordIDs

func (tcc *TradeConditionCreate) AddRecordIDs(ids ...int) *TradeConditionCreate

AddRecordIDs adds the "record" edge to the TradeRecord entity by IDs.

func (*TradeConditionCreate) Exec

func (tcc *TradeConditionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TradeConditionCreate) ExecX

func (tcc *TradeConditionCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TradeConditionCreate) Mutation

Mutation returns the TradeConditionMutation object of the builder.

func (*TradeConditionCreate) Save

Save creates the TradeCondition in the database.

func (*TradeConditionCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*TradeConditionCreate) SetCondition

func (tcc *TradeConditionCreate) SetCondition(s string) *TradeConditionCreate

SetCondition sets the "condition" field.

type TradeConditionCreateBulk

type TradeConditionCreateBulk struct {
	// contains filtered or unexported fields
}

TradeConditionCreateBulk is the builder for creating many TradeCondition entities in bulk.

func (*TradeConditionCreateBulk) Exec

Exec executes the query.

func (*TradeConditionCreateBulk) ExecX

func (tccb *TradeConditionCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TradeConditionCreateBulk) Save

Save creates the TradeCondition entities in the database.

func (*TradeConditionCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type TradeConditionDelete

type TradeConditionDelete struct {
	// contains filtered or unexported fields
}

TradeConditionDelete is the builder for deleting a TradeCondition entity.

func (*TradeConditionDelete) Exec

func (tcd *TradeConditionDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*TradeConditionDelete) ExecX

func (tcd *TradeConditionDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*TradeConditionDelete) Where

Where appends a list predicates to the TradeConditionDelete builder.

type TradeConditionDeleteOne

type TradeConditionDeleteOne struct {
	// contains filtered or unexported fields
}

TradeConditionDeleteOne is the builder for deleting a single TradeCondition entity.

func (*TradeConditionDeleteOne) Exec

func (tcdo *TradeConditionDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TradeConditionDeleteOne) ExecX

func (tcdo *TradeConditionDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type TradeConditionEdges

type TradeConditionEdges struct {
	// Record holds the value of the record edge.
	Record []*TradeRecord `json:"record,omitempty"`
	// contains filtered or unexported fields
}

TradeConditionEdges holds the relations/edges for other nodes in the graph.

func (TradeConditionEdges) RecordOrErr

func (e TradeConditionEdges) RecordOrErr() ([]*TradeRecord, error)

RecordOrErr returns the Record value or an error if the edge was not loaded in eager-loading.

type TradeConditionGroupBy

type TradeConditionGroupBy struct {
	// contains filtered or unexported fields
}

TradeConditionGroupBy is the group-by builder for TradeCondition entities.

func (*TradeConditionGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*TradeConditionGroupBy) Bool

func (s *TradeConditionGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TradeConditionGroupBy) BoolX

func (s *TradeConditionGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TradeConditionGroupBy) Bools

func (s *TradeConditionGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TradeConditionGroupBy) BoolsX

func (s *TradeConditionGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TradeConditionGroupBy) Float64

func (s *TradeConditionGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TradeConditionGroupBy) Float64X

func (s *TradeConditionGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TradeConditionGroupBy) Float64s

func (s *TradeConditionGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TradeConditionGroupBy) Float64sX

func (s *TradeConditionGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TradeConditionGroupBy) Int

func (s *TradeConditionGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TradeConditionGroupBy) IntX

func (s *TradeConditionGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TradeConditionGroupBy) Ints

func (s *TradeConditionGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TradeConditionGroupBy) IntsX

func (s *TradeConditionGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TradeConditionGroupBy) Scan

func (tcgb *TradeConditionGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TradeConditionGroupBy) ScanX

func (s *TradeConditionGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TradeConditionGroupBy) String

func (s *TradeConditionGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TradeConditionGroupBy) StringX

func (s *TradeConditionGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TradeConditionGroupBy) Strings

func (s *TradeConditionGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TradeConditionGroupBy) StringsX

func (s *TradeConditionGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TradeConditionMutation

type TradeConditionMutation struct {
	// contains filtered or unexported fields
}

TradeConditionMutation represents an operation that mutates the TradeCondition nodes in the graph.

func (*TradeConditionMutation) AddField

func (m *TradeConditionMutation) 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 (*TradeConditionMutation) AddRecordIDs

func (m *TradeConditionMutation) AddRecordIDs(ids ...int)

AddRecordIDs adds the "record" edge to the TradeRecord entity by ids.

func (*TradeConditionMutation) AddedEdges

func (m *TradeConditionMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*TradeConditionMutation) AddedField

func (m *TradeConditionMutation) 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 (*TradeConditionMutation) AddedFields

func (m *TradeConditionMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*TradeConditionMutation) AddedIDs

func (m *TradeConditionMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*TradeConditionMutation) ClearEdge

func (m *TradeConditionMutation) 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 (*TradeConditionMutation) ClearField

func (m *TradeConditionMutation) 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 (*TradeConditionMutation) ClearRecord

func (m *TradeConditionMutation) ClearRecord()

ClearRecord clears the "record" edge to the TradeRecord entity.

func (*TradeConditionMutation) ClearedEdges

func (m *TradeConditionMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*TradeConditionMutation) ClearedFields

func (m *TradeConditionMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (TradeConditionMutation) Client

func (m TradeConditionMutation) 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 (*TradeConditionMutation) Condition

func (m *TradeConditionMutation) Condition() (r string, exists bool)

Condition returns the value of the "condition" field in the mutation.

func (*TradeConditionMutation) EdgeCleared

func (m *TradeConditionMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*TradeConditionMutation) Field

func (m *TradeConditionMutation) 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 (*TradeConditionMutation) FieldCleared

func (m *TradeConditionMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*TradeConditionMutation) Fields

func (m *TradeConditionMutation) 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 (*TradeConditionMutation) ID

func (m *TradeConditionMutation) 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 (*TradeConditionMutation) IDs

func (m *TradeConditionMutation) 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 (*TradeConditionMutation) OldCondition

func (m *TradeConditionMutation) OldCondition(ctx context.Context) (v string, err error)

OldCondition returns the old "condition" field's value of the TradeCondition entity. If the TradeCondition 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 (*TradeConditionMutation) OldField

func (m *TradeConditionMutation) 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 (*TradeConditionMutation) Op

func (m *TradeConditionMutation) Op() Op

Op returns the operation name.

func (*TradeConditionMutation) RecordCleared

func (m *TradeConditionMutation) RecordCleared() bool

RecordCleared reports if the "record" edge to the TradeRecord entity was cleared.

func (*TradeConditionMutation) RecordIDs

func (m *TradeConditionMutation) RecordIDs() (ids []int)

RecordIDs returns the "record" edge IDs in the mutation.

func (*TradeConditionMutation) RemoveRecordIDs

func (m *TradeConditionMutation) RemoveRecordIDs(ids ...int)

RemoveRecordIDs removes the "record" edge to the TradeRecord entity by IDs.

func (*TradeConditionMutation) RemovedEdges

func (m *TradeConditionMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*TradeConditionMutation) RemovedIDs

func (m *TradeConditionMutation) 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 (*TradeConditionMutation) RemovedRecordIDs

func (m *TradeConditionMutation) RemovedRecordIDs() (ids []int)

RemovedRecord returns the removed IDs of the "record" edge to the TradeRecord entity.

func (*TradeConditionMutation) ResetCondition

func (m *TradeConditionMutation) ResetCondition()

ResetCondition resets all changes to the "condition" field.

func (*TradeConditionMutation) ResetEdge

func (m *TradeConditionMutation) 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 (*TradeConditionMutation) ResetField

func (m *TradeConditionMutation) 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 (*TradeConditionMutation) ResetRecord

func (m *TradeConditionMutation) ResetRecord()

ResetRecord resets all changes to the "record" edge.

func (*TradeConditionMutation) SetCondition

func (m *TradeConditionMutation) SetCondition(s string)

SetCondition sets the "condition" field.

func (*TradeConditionMutation) SetField

func (m *TradeConditionMutation) 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 (*TradeConditionMutation) SetOp

func (m *TradeConditionMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (TradeConditionMutation) Tx

func (m TradeConditionMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*TradeConditionMutation) Type

func (m *TradeConditionMutation) Type() string

Type returns the node type of this mutation (TradeCondition).

func (*TradeConditionMutation) Where

Where appends a list predicates to the TradeConditionMutation builder.

func (*TradeConditionMutation) WhereP

func (m *TradeConditionMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the TradeConditionMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type TradeConditionQuery

type TradeConditionQuery struct {
	// contains filtered or unexported fields
}

TradeConditionQuery is the builder for querying TradeCondition entities.

func (*TradeConditionQuery) Aggregate

func (tcq *TradeConditionQuery) Aggregate(fns ...AggregateFunc) *TradeConditionSelect

Aggregate returns a TradeConditionSelect configured with the given aggregations.

func (*TradeConditionQuery) All

All executes the query and returns a list of TradeConditions.

func (*TradeConditionQuery) AllX

AllX is like All, but panics if an error occurs.

func (*TradeConditionQuery) Clone

Clone returns a duplicate of the TradeConditionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*TradeConditionQuery) Count

func (tcq *TradeConditionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TradeConditionQuery) CountX

func (tcq *TradeConditionQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*TradeConditionQuery) Exist

func (tcq *TradeConditionQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*TradeConditionQuery) ExistX

func (tcq *TradeConditionQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*TradeConditionQuery) First

First returns the first TradeCondition entity from the query. Returns a *NotFoundError when no TradeCondition was found.

func (*TradeConditionQuery) FirstID

func (tcq *TradeConditionQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first TradeCondition ID from the query. Returns a *NotFoundError when no TradeCondition ID was found.

func (*TradeConditionQuery) FirstIDX

func (tcq *TradeConditionQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*TradeConditionQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*TradeConditionQuery) GroupBy

func (tcq *TradeConditionQuery) GroupBy(field string, fields ...string) *TradeConditionGroupBy

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 {
	Condition string `json:"condition,omitempty"`
	Count int `json:"count,omitempty"`
}

client.TradeCondition.Query().
	GroupBy(tradecondition.FieldCondition).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TradeConditionQuery) IDs

func (tcq *TradeConditionQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of TradeCondition IDs.

func (*TradeConditionQuery) IDsX

func (tcq *TradeConditionQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*TradeConditionQuery) Limit

func (tcq *TradeConditionQuery) Limit(limit int) *TradeConditionQuery

Limit the number of records to be returned by this query.

func (*TradeConditionQuery) Offset

func (tcq *TradeConditionQuery) Offset(offset int) *TradeConditionQuery

Offset to start from.

func (*TradeConditionQuery) Only

Only returns a single TradeCondition entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one TradeCondition entity is found. Returns a *NotFoundError when no TradeCondition entities are found.

func (*TradeConditionQuery) OnlyID

func (tcq *TradeConditionQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only TradeCondition ID in the query. Returns a *NotSingularError when more than one TradeCondition ID is found. Returns a *NotFoundError when no entities are found.

func (*TradeConditionQuery) OnlyIDX

func (tcq *TradeConditionQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*TradeConditionQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*TradeConditionQuery) Order

Order specifies how the records should be ordered.

func (*TradeConditionQuery) QueryRecord

func (tcq *TradeConditionQuery) QueryRecord() *TradeRecordQuery

QueryRecord chains the current query on the "record" edge.

func (*TradeConditionQuery) Select

func (tcq *TradeConditionQuery) Select(fields ...string) *TradeConditionSelect

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 {
	Condition string `json:"condition,omitempty"`
}

client.TradeCondition.Query().
	Select(tradecondition.FieldCondition).
	Scan(ctx, &v)

func (*TradeConditionQuery) Unique

func (tcq *TradeConditionQuery) Unique(unique bool) *TradeConditionQuery

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 (*TradeConditionQuery) Where

Where adds a new predicate for the TradeConditionQuery builder.

func (*TradeConditionQuery) WithRecord

func (tcq *TradeConditionQuery) WithRecord(opts ...func(*TradeRecordQuery)) *TradeConditionQuery

WithRecord tells the query-builder to eager-load the nodes that are connected to the "record" edge. The optional arguments are used to configure the query builder of the edge.

type TradeConditionSelect

type TradeConditionSelect struct {
	*TradeConditionQuery
	// contains filtered or unexported fields
}

TradeConditionSelect is the builder for selecting fields of TradeCondition entities.

func (*TradeConditionSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*TradeConditionSelect) Bool

func (s *TradeConditionSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TradeConditionSelect) BoolX

func (s *TradeConditionSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TradeConditionSelect) Bools

func (s *TradeConditionSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TradeConditionSelect) BoolsX

func (s *TradeConditionSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TradeConditionSelect) Float64

func (s *TradeConditionSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TradeConditionSelect) Float64X

func (s *TradeConditionSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TradeConditionSelect) Float64s

func (s *TradeConditionSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TradeConditionSelect) Float64sX

func (s *TradeConditionSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TradeConditionSelect) Int

func (s *TradeConditionSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TradeConditionSelect) IntX

func (s *TradeConditionSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TradeConditionSelect) Ints

func (s *TradeConditionSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TradeConditionSelect) IntsX

func (s *TradeConditionSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TradeConditionSelect) Scan

func (tcs *TradeConditionSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TradeConditionSelect) ScanX

func (s *TradeConditionSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TradeConditionSelect) String

func (s *TradeConditionSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TradeConditionSelect) StringX

func (s *TradeConditionSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TradeConditionSelect) Strings

func (s *TradeConditionSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TradeConditionSelect) StringsX

func (s *TradeConditionSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TradeConditionUpdate

type TradeConditionUpdate struct {
	// contains filtered or unexported fields
}

TradeConditionUpdate is the builder for updating TradeCondition entities.

func (*TradeConditionUpdate) AddRecord

func (tcu *TradeConditionUpdate) AddRecord(t ...*TradeRecord) *TradeConditionUpdate

AddRecord adds the "record" edges to the TradeRecord entity.

func (*TradeConditionUpdate) AddRecordIDs

func (tcu *TradeConditionUpdate) AddRecordIDs(ids ...int) *TradeConditionUpdate

AddRecordIDs adds the "record" edge to the TradeRecord entity by IDs.

func (*TradeConditionUpdate) ClearRecord

func (tcu *TradeConditionUpdate) ClearRecord() *TradeConditionUpdate

ClearRecord clears all "record" edges to the TradeRecord entity.

func (*TradeConditionUpdate) Exec

func (tcu *TradeConditionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TradeConditionUpdate) ExecX

func (tcu *TradeConditionUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TradeConditionUpdate) Mutation

Mutation returns the TradeConditionMutation object of the builder.

func (*TradeConditionUpdate) RemoveRecord

func (tcu *TradeConditionUpdate) RemoveRecord(t ...*TradeRecord) *TradeConditionUpdate

RemoveRecord removes "record" edges to TradeRecord entities.

func (*TradeConditionUpdate) RemoveRecordIDs

func (tcu *TradeConditionUpdate) RemoveRecordIDs(ids ...int) *TradeConditionUpdate

RemoveRecordIDs removes the "record" edge to TradeRecord entities by IDs.

func (*TradeConditionUpdate) Save

func (tcu *TradeConditionUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*TradeConditionUpdate) SaveX

func (tcu *TradeConditionUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*TradeConditionUpdate) SetCondition

func (tcu *TradeConditionUpdate) SetCondition(s string) *TradeConditionUpdate

SetCondition sets the "condition" field.

func (*TradeConditionUpdate) Where

Where appends a list predicates to the TradeConditionUpdate builder.

type TradeConditionUpdateOne

type TradeConditionUpdateOne struct {
	// contains filtered or unexported fields
}

TradeConditionUpdateOne is the builder for updating a single TradeCondition entity.

func (*TradeConditionUpdateOne) AddRecord

AddRecord adds the "record" edges to the TradeRecord entity.

func (*TradeConditionUpdateOne) AddRecordIDs

func (tcuo *TradeConditionUpdateOne) AddRecordIDs(ids ...int) *TradeConditionUpdateOne

AddRecordIDs adds the "record" edge to the TradeRecord entity by IDs.

func (*TradeConditionUpdateOne) ClearRecord

func (tcuo *TradeConditionUpdateOne) ClearRecord() *TradeConditionUpdateOne

ClearRecord clears all "record" edges to the TradeRecord entity.

func (*TradeConditionUpdateOne) Exec

func (tcuo *TradeConditionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TradeConditionUpdateOne) ExecX

func (tcuo *TradeConditionUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TradeConditionUpdateOne) Mutation

Mutation returns the TradeConditionMutation object of the builder.

func (*TradeConditionUpdateOne) RemoveRecord

func (tcuo *TradeConditionUpdateOne) RemoveRecord(t ...*TradeRecord) *TradeConditionUpdateOne

RemoveRecord removes "record" edges to TradeRecord entities.

func (*TradeConditionUpdateOne) RemoveRecordIDs

func (tcuo *TradeConditionUpdateOne) RemoveRecordIDs(ids ...int) *TradeConditionUpdateOne

RemoveRecordIDs removes the "record" edge to TradeRecord entities by IDs.

func (*TradeConditionUpdateOne) Save

Save executes the query and returns the updated TradeCondition entity.

func (*TradeConditionUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*TradeConditionUpdateOne) Select

func (tcuo *TradeConditionUpdateOne) Select(field string, fields ...string) *TradeConditionUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*TradeConditionUpdateOne) SetCondition

SetCondition sets the "condition" field.

type TradeConditions

type TradeConditions []*TradeCondition

TradeConditions is a parsable slice of TradeCondition.

type TradeCorrection

type TradeCorrection struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Correction holds the value of the "correction" field.
	Correction string `json:"correction,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TradeCorrectionQuery when eager-loading is set.
	Edges TradeCorrectionEdges `json:"edges"`
	// contains filtered or unexported fields
}

TradeCorrection is the model entity for the TradeCorrection schema.

func (*TradeCorrection) QueryRecord

func (tc *TradeCorrection) QueryRecord() *TradeRecordQuery

QueryRecord queries the "record" edge of the TradeCorrection entity.

func (*TradeCorrection) String

func (tc *TradeCorrection) String() string

String implements the fmt.Stringer.

func (*TradeCorrection) Unwrap

func (tc *TradeCorrection) Unwrap() *TradeCorrection

Unwrap unwraps the TradeCorrection 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 (*TradeCorrection) Update

Update returns a builder for updating this TradeCorrection. Note that you need to call TradeCorrection.Unwrap() before calling this method if this TradeCorrection was returned from a transaction, and the transaction was committed or rolled back.

type TradeCorrectionClient

type TradeCorrectionClient struct {
	// contains filtered or unexported fields
}

TradeCorrectionClient is a client for the TradeCorrection schema.

func NewTradeCorrectionClient

func NewTradeCorrectionClient(c config) *TradeCorrectionClient

NewTradeCorrectionClient returns a client for the TradeCorrection from the given config.

func (*TradeCorrectionClient) Create

Create returns a builder for creating a TradeCorrection entity.

func (*TradeCorrectionClient) CreateBulk

CreateBulk returns a builder for creating a bulk of TradeCorrection entities.

func (*TradeCorrectionClient) Delete

Delete returns a delete builder for TradeCorrection.

func (*TradeCorrectionClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TradeCorrectionClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*TradeCorrectionClient) Get

Get returns a TradeCorrection entity by its id.

func (*TradeCorrectionClient) GetX

GetX is like Get, but panics if an error occurs.

func (*TradeCorrectionClient) Hooks

func (c *TradeCorrectionClient) Hooks() []Hook

Hooks returns the client hooks.

func (*TradeCorrectionClient) Intercept

func (c *TradeCorrectionClient) Intercept(interceptors ...Interceptor)

Use adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `tradecorrection.Intercept(f(g(h())))`.

func (*TradeCorrectionClient) Interceptors

func (c *TradeCorrectionClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*TradeCorrectionClient) Query

Query returns a query builder for TradeCorrection.

func (*TradeCorrectionClient) QueryRecord

QueryRecord queries the record edge of a TradeCorrection.

func (*TradeCorrectionClient) Update

Update returns an update builder for TradeCorrection.

func (*TradeCorrectionClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*TradeCorrectionClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*TradeCorrectionClient) Use

func (c *TradeCorrectionClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `tradecorrection.Hooks(f(g(h())))`.

type TradeCorrectionCreate

type TradeCorrectionCreate struct {
	// contains filtered or unexported fields
}

TradeCorrectionCreate is the builder for creating a TradeCorrection entity.

func (*TradeCorrectionCreate) AddRecord

AddRecord adds the "record" edges to the TradeRecord entity.

func (*TradeCorrectionCreate) AddRecordIDs

func (tcc *TradeCorrectionCreate) AddRecordIDs(ids ...int) *TradeCorrectionCreate

AddRecordIDs adds the "record" edge to the TradeRecord entity by IDs.

func (*TradeCorrectionCreate) Exec

func (tcc *TradeCorrectionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TradeCorrectionCreate) ExecX

func (tcc *TradeCorrectionCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TradeCorrectionCreate) Mutation

Mutation returns the TradeCorrectionMutation object of the builder.

func (*TradeCorrectionCreate) Save

Save creates the TradeCorrection in the database.

func (*TradeCorrectionCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*TradeCorrectionCreate) SetCorrection

func (tcc *TradeCorrectionCreate) SetCorrection(s string) *TradeCorrectionCreate

SetCorrection sets the "correction" field.

type TradeCorrectionCreateBulk

type TradeCorrectionCreateBulk struct {
	// contains filtered or unexported fields
}

TradeCorrectionCreateBulk is the builder for creating many TradeCorrection entities in bulk.

func (*TradeCorrectionCreateBulk) Exec

Exec executes the query.

func (*TradeCorrectionCreateBulk) ExecX

func (tccb *TradeCorrectionCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TradeCorrectionCreateBulk) Save

Save creates the TradeCorrection entities in the database.

func (*TradeCorrectionCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type TradeCorrectionDelete

type TradeCorrectionDelete struct {
	// contains filtered or unexported fields
}

TradeCorrectionDelete is the builder for deleting a TradeCorrection entity.

func (*TradeCorrectionDelete) Exec

func (tcd *TradeCorrectionDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*TradeCorrectionDelete) ExecX

func (tcd *TradeCorrectionDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*TradeCorrectionDelete) Where

Where appends a list predicates to the TradeCorrectionDelete builder.

type TradeCorrectionDeleteOne

type TradeCorrectionDeleteOne struct {
	// contains filtered or unexported fields
}

TradeCorrectionDeleteOne is the builder for deleting a single TradeCorrection entity.

func (*TradeCorrectionDeleteOne) Exec

Exec executes the deletion query.

func (*TradeCorrectionDeleteOne) ExecX

func (tcdo *TradeCorrectionDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type TradeCorrectionEdges

type TradeCorrectionEdges struct {
	// Record holds the value of the record edge.
	Record []*TradeRecord `json:"record,omitempty"`
	// contains filtered or unexported fields
}

TradeCorrectionEdges holds the relations/edges for other nodes in the graph.

func (TradeCorrectionEdges) RecordOrErr

func (e TradeCorrectionEdges) RecordOrErr() ([]*TradeRecord, error)

RecordOrErr returns the Record value or an error if the edge was not loaded in eager-loading.

type TradeCorrectionGroupBy

type TradeCorrectionGroupBy struct {
	// contains filtered or unexported fields
}

TradeCorrectionGroupBy is the group-by builder for TradeCorrection entities.

func (*TradeCorrectionGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*TradeCorrectionGroupBy) Bool

func (s *TradeCorrectionGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TradeCorrectionGroupBy) BoolX

func (s *TradeCorrectionGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TradeCorrectionGroupBy) Bools

func (s *TradeCorrectionGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TradeCorrectionGroupBy) BoolsX

func (s *TradeCorrectionGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TradeCorrectionGroupBy) Float64

func (s *TradeCorrectionGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TradeCorrectionGroupBy) Float64X

func (s *TradeCorrectionGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TradeCorrectionGroupBy) Float64s

func (s *TradeCorrectionGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TradeCorrectionGroupBy) Float64sX

func (s *TradeCorrectionGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TradeCorrectionGroupBy) Int

func (s *TradeCorrectionGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TradeCorrectionGroupBy) IntX

func (s *TradeCorrectionGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TradeCorrectionGroupBy) Ints

func (s *TradeCorrectionGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TradeCorrectionGroupBy) IntsX

func (s *TradeCorrectionGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TradeCorrectionGroupBy) Scan

func (tcgb *TradeCorrectionGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TradeCorrectionGroupBy) ScanX

func (s *TradeCorrectionGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TradeCorrectionGroupBy) String

func (s *TradeCorrectionGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TradeCorrectionGroupBy) StringX

func (s *TradeCorrectionGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TradeCorrectionGroupBy) Strings

func (s *TradeCorrectionGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TradeCorrectionGroupBy) StringsX

func (s *TradeCorrectionGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TradeCorrectionMutation

type TradeCorrectionMutation struct {
	// contains filtered or unexported fields
}

TradeCorrectionMutation represents an operation that mutates the TradeCorrection nodes in the graph.

func (*TradeCorrectionMutation) AddField

func (m *TradeCorrectionMutation) 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 (*TradeCorrectionMutation) AddRecordIDs

func (m *TradeCorrectionMutation) AddRecordIDs(ids ...int)

AddRecordIDs adds the "record" edge to the TradeRecord entity by ids.

func (*TradeCorrectionMutation) AddedEdges

func (m *TradeCorrectionMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*TradeCorrectionMutation) AddedField

func (m *TradeCorrectionMutation) 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 (*TradeCorrectionMutation) AddedFields

func (m *TradeCorrectionMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*TradeCorrectionMutation) AddedIDs

func (m *TradeCorrectionMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*TradeCorrectionMutation) ClearEdge

func (m *TradeCorrectionMutation) 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 (*TradeCorrectionMutation) ClearField

func (m *TradeCorrectionMutation) 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 (*TradeCorrectionMutation) ClearRecord

func (m *TradeCorrectionMutation) ClearRecord()

ClearRecord clears the "record" edge to the TradeRecord entity.

func (*TradeCorrectionMutation) ClearedEdges

func (m *TradeCorrectionMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*TradeCorrectionMutation) ClearedFields

func (m *TradeCorrectionMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (TradeCorrectionMutation) Client

func (m TradeCorrectionMutation) 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 (*TradeCorrectionMutation) Correction

func (m *TradeCorrectionMutation) Correction() (r string, exists bool)

Correction returns the value of the "correction" field in the mutation.

func (*TradeCorrectionMutation) EdgeCleared

func (m *TradeCorrectionMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*TradeCorrectionMutation) Field

func (m *TradeCorrectionMutation) 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 (*TradeCorrectionMutation) FieldCleared

func (m *TradeCorrectionMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*TradeCorrectionMutation) Fields

func (m *TradeCorrectionMutation) 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 (*TradeCorrectionMutation) ID

func (m *TradeCorrectionMutation) 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 (*TradeCorrectionMutation) IDs

func (m *TradeCorrectionMutation) 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 (*TradeCorrectionMutation) OldCorrection

func (m *TradeCorrectionMutation) OldCorrection(ctx context.Context) (v string, err error)

OldCorrection returns the old "correction" field's value of the TradeCorrection entity. If the TradeCorrection 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 (*TradeCorrectionMutation) OldField

func (m *TradeCorrectionMutation) 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 (*TradeCorrectionMutation) Op

func (m *TradeCorrectionMutation) Op() Op

Op returns the operation name.

func (*TradeCorrectionMutation) RecordCleared

func (m *TradeCorrectionMutation) RecordCleared() bool

RecordCleared reports if the "record" edge to the TradeRecord entity was cleared.

func (*TradeCorrectionMutation) RecordIDs

func (m *TradeCorrectionMutation) RecordIDs() (ids []int)

RecordIDs returns the "record" edge IDs in the mutation.

func (*TradeCorrectionMutation) RemoveRecordIDs

func (m *TradeCorrectionMutation) RemoveRecordIDs(ids ...int)

RemoveRecordIDs removes the "record" edge to the TradeRecord entity by IDs.

func (*TradeCorrectionMutation) RemovedEdges

func (m *TradeCorrectionMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*TradeCorrectionMutation) RemovedIDs

func (m *TradeCorrectionMutation) 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 (*TradeCorrectionMutation) RemovedRecordIDs

func (m *TradeCorrectionMutation) RemovedRecordIDs() (ids []int)

RemovedRecord returns the removed IDs of the "record" edge to the TradeRecord entity.

func (*TradeCorrectionMutation) ResetCorrection

func (m *TradeCorrectionMutation) ResetCorrection()

ResetCorrection resets all changes to the "correction" field.

func (*TradeCorrectionMutation) ResetEdge

func (m *TradeCorrectionMutation) 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 (*TradeCorrectionMutation) ResetField

func (m *TradeCorrectionMutation) 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 (*TradeCorrectionMutation) ResetRecord

func (m *TradeCorrectionMutation) ResetRecord()

ResetRecord resets all changes to the "record" edge.

func (*TradeCorrectionMutation) SetCorrection

func (m *TradeCorrectionMutation) SetCorrection(s string)

SetCorrection sets the "correction" field.

func (*TradeCorrectionMutation) SetField

func (m *TradeCorrectionMutation) 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 (*TradeCorrectionMutation) SetOp

func (m *TradeCorrectionMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (TradeCorrectionMutation) Tx

func (m TradeCorrectionMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*TradeCorrectionMutation) Type

func (m *TradeCorrectionMutation) Type() string

Type returns the node type of this mutation (TradeCorrection).

func (*TradeCorrectionMutation) Where

Where appends a list predicates to the TradeCorrectionMutation builder.

func (*TradeCorrectionMutation) WhereP

func (m *TradeCorrectionMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the TradeCorrectionMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type TradeCorrectionQuery

type TradeCorrectionQuery struct {
	// contains filtered or unexported fields
}

TradeCorrectionQuery is the builder for querying TradeCorrection entities.

func (*TradeCorrectionQuery) Aggregate

Aggregate returns a TradeCorrectionSelect configured with the given aggregations.

func (*TradeCorrectionQuery) All

All executes the query and returns a list of TradeCorrections.

func (*TradeCorrectionQuery) AllX

AllX is like All, but panics if an error occurs.

func (*TradeCorrectionQuery) Clone

Clone returns a duplicate of the TradeCorrectionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*TradeCorrectionQuery) Count

func (tcq *TradeCorrectionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TradeCorrectionQuery) CountX

func (tcq *TradeCorrectionQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*TradeCorrectionQuery) Exist

func (tcq *TradeCorrectionQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*TradeCorrectionQuery) ExistX

func (tcq *TradeCorrectionQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*TradeCorrectionQuery) First

First returns the first TradeCorrection entity from the query. Returns a *NotFoundError when no TradeCorrection was found.

func (*TradeCorrectionQuery) FirstID

func (tcq *TradeCorrectionQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first TradeCorrection ID from the query. Returns a *NotFoundError when no TradeCorrection ID was found.

func (*TradeCorrectionQuery) FirstIDX

func (tcq *TradeCorrectionQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*TradeCorrectionQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*TradeCorrectionQuery) GroupBy

func (tcq *TradeCorrectionQuery) GroupBy(field string, fields ...string) *TradeCorrectionGroupBy

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 {
	Correction string `json:"correction,omitempty"`
	Count int `json:"count,omitempty"`
}

client.TradeCorrection.Query().
	GroupBy(tradecorrection.FieldCorrection).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TradeCorrectionQuery) IDs

func (tcq *TradeCorrectionQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of TradeCorrection IDs.

func (*TradeCorrectionQuery) IDsX

func (tcq *TradeCorrectionQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*TradeCorrectionQuery) Limit

func (tcq *TradeCorrectionQuery) Limit(limit int) *TradeCorrectionQuery

Limit the number of records to be returned by this query.

func (*TradeCorrectionQuery) Offset

func (tcq *TradeCorrectionQuery) Offset(offset int) *TradeCorrectionQuery

Offset to start from.

func (*TradeCorrectionQuery) Only

Only returns a single TradeCorrection entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one TradeCorrection entity is found. Returns a *NotFoundError when no TradeCorrection entities are found.

func (*TradeCorrectionQuery) OnlyID

func (tcq *TradeCorrectionQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only TradeCorrection ID in the query. Returns a *NotSingularError when more than one TradeCorrection ID is found. Returns a *NotFoundError when no entities are found.

func (*TradeCorrectionQuery) OnlyIDX

func (tcq *TradeCorrectionQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*TradeCorrectionQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*TradeCorrectionQuery) Order

Order specifies how the records should be ordered.

func (*TradeCorrectionQuery) QueryRecord

func (tcq *TradeCorrectionQuery) QueryRecord() *TradeRecordQuery

QueryRecord chains the current query on the "record" edge.

func (*TradeCorrectionQuery) Select

func (tcq *TradeCorrectionQuery) Select(fields ...string) *TradeCorrectionSelect

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 {
	Correction string `json:"correction,omitempty"`
}

client.TradeCorrection.Query().
	Select(tradecorrection.FieldCorrection).
	Scan(ctx, &v)

func (*TradeCorrectionQuery) Unique

func (tcq *TradeCorrectionQuery) Unique(unique bool) *TradeCorrectionQuery

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 (*TradeCorrectionQuery) Where

Where adds a new predicate for the TradeCorrectionQuery builder.

func (*TradeCorrectionQuery) WithRecord

func (tcq *TradeCorrectionQuery) WithRecord(opts ...func(*TradeRecordQuery)) *TradeCorrectionQuery

WithRecord tells the query-builder to eager-load the nodes that are connected to the "record" edge. The optional arguments are used to configure the query builder of the edge.

type TradeCorrectionSelect

type TradeCorrectionSelect struct {
	*TradeCorrectionQuery
	// contains filtered or unexported fields
}

TradeCorrectionSelect is the builder for selecting fields of TradeCorrection entities.

func (*TradeCorrectionSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*TradeCorrectionSelect) Bool

func (s *TradeCorrectionSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TradeCorrectionSelect) BoolX

func (s *TradeCorrectionSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TradeCorrectionSelect) Bools

func (s *TradeCorrectionSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TradeCorrectionSelect) BoolsX

func (s *TradeCorrectionSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TradeCorrectionSelect) Float64

func (s *TradeCorrectionSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TradeCorrectionSelect) Float64X

func (s *TradeCorrectionSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TradeCorrectionSelect) Float64s

func (s *TradeCorrectionSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TradeCorrectionSelect) Float64sX

func (s *TradeCorrectionSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TradeCorrectionSelect) Int

func (s *TradeCorrectionSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TradeCorrectionSelect) IntX

func (s *TradeCorrectionSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TradeCorrectionSelect) Ints

func (s *TradeCorrectionSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TradeCorrectionSelect) IntsX

func (s *TradeCorrectionSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TradeCorrectionSelect) Scan

func (tcs *TradeCorrectionSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TradeCorrectionSelect) ScanX

func (s *TradeCorrectionSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TradeCorrectionSelect) String

func (s *TradeCorrectionSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TradeCorrectionSelect) StringX

func (s *TradeCorrectionSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TradeCorrectionSelect) Strings

func (s *TradeCorrectionSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TradeCorrectionSelect) StringsX

func (s *TradeCorrectionSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TradeCorrectionUpdate

type TradeCorrectionUpdate struct {
	// contains filtered or unexported fields
}

TradeCorrectionUpdate is the builder for updating TradeCorrection entities.

func (*TradeCorrectionUpdate) AddRecord

AddRecord adds the "record" edges to the TradeRecord entity.

func (*TradeCorrectionUpdate) AddRecordIDs

func (tcu *TradeCorrectionUpdate) AddRecordIDs(ids ...int) *TradeCorrectionUpdate

AddRecordIDs adds the "record" edge to the TradeRecord entity by IDs.

func (*TradeCorrectionUpdate) ClearRecord

func (tcu *TradeCorrectionUpdate) ClearRecord() *TradeCorrectionUpdate

ClearRecord clears all "record" edges to the TradeRecord entity.

func (*TradeCorrectionUpdate) Exec

func (tcu *TradeCorrectionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TradeCorrectionUpdate) ExecX

func (tcu *TradeCorrectionUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TradeCorrectionUpdate) Mutation

Mutation returns the TradeCorrectionMutation object of the builder.

func (*TradeCorrectionUpdate) RemoveRecord

func (tcu *TradeCorrectionUpdate) RemoveRecord(t ...*TradeRecord) *TradeCorrectionUpdate

RemoveRecord removes "record" edges to TradeRecord entities.

func (*TradeCorrectionUpdate) RemoveRecordIDs

func (tcu *TradeCorrectionUpdate) RemoveRecordIDs(ids ...int) *TradeCorrectionUpdate

RemoveRecordIDs removes the "record" edge to TradeRecord entities by IDs.

func (*TradeCorrectionUpdate) Save

func (tcu *TradeCorrectionUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*TradeCorrectionUpdate) SaveX

func (tcu *TradeCorrectionUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*TradeCorrectionUpdate) SetCorrection

func (tcu *TradeCorrectionUpdate) SetCorrection(s string) *TradeCorrectionUpdate

SetCorrection sets the "correction" field.

func (*TradeCorrectionUpdate) Where

Where appends a list predicates to the TradeCorrectionUpdate builder.

type TradeCorrectionUpdateOne

type TradeCorrectionUpdateOne struct {
	// contains filtered or unexported fields
}

TradeCorrectionUpdateOne is the builder for updating a single TradeCorrection entity.

func (*TradeCorrectionUpdateOne) AddRecord

AddRecord adds the "record" edges to the TradeRecord entity.

func (*TradeCorrectionUpdateOne) AddRecordIDs

func (tcuo *TradeCorrectionUpdateOne) AddRecordIDs(ids ...int) *TradeCorrectionUpdateOne

AddRecordIDs adds the "record" edge to the TradeRecord entity by IDs.

func (*TradeCorrectionUpdateOne) ClearRecord

ClearRecord clears all "record" edges to the TradeRecord entity.

func (*TradeCorrectionUpdateOne) Exec

Exec executes the query on the entity.

func (*TradeCorrectionUpdateOne) ExecX

func (tcuo *TradeCorrectionUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TradeCorrectionUpdateOne) Mutation

Mutation returns the TradeCorrectionMutation object of the builder.

func (*TradeCorrectionUpdateOne) RemoveRecord

RemoveRecord removes "record" edges to TradeRecord entities.

func (*TradeCorrectionUpdateOne) RemoveRecordIDs

func (tcuo *TradeCorrectionUpdateOne) RemoveRecordIDs(ids ...int) *TradeCorrectionUpdateOne

RemoveRecordIDs removes the "record" edge to TradeRecord entities by IDs.

func (*TradeCorrectionUpdateOne) Save

Save executes the query and returns the updated TradeCorrection entity.

func (*TradeCorrectionUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*TradeCorrectionUpdateOne) Select

func (tcuo *TradeCorrectionUpdateOne) Select(field string, fields ...string) *TradeCorrectionUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*TradeCorrectionUpdateOne) SetCorrection

SetCorrection sets the "correction" field.

type TradeCorrections

type TradeCorrections []*TradeCorrection

TradeCorrections is a parsable slice of TradeCorrection.

type TradeRecord

type TradeRecord struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Price holds the value of the "price" field.
	Price float64 `json:"price,omitempty"`
	// Timestamp holds the value of the "timestamp" field.
	Timestamp time.Time `json:"timestamp,omitempty"`
	// Volume holds the value of the "volume" field.
	Volume int32 `json:"volume,omitempty"`
	// TimeRangeID holds the value of the "time_range_id" field.
	TimeRangeID int `json:"time_range_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TradeRecordQuery when eager-loading is set.
	Edges TradeRecordEdges `json:"edges"`
	// contains filtered or unexported fields
}

TradeRecord is the model entity for the TradeRecord schema.

func (*TradeRecord) QueryConditions

func (tr *TradeRecord) QueryConditions() *TradeConditionQuery

QueryConditions queries the "conditions" edge of the TradeRecord entity.

func (*TradeRecord) QueryCorrection

func (tr *TradeRecord) QueryCorrection() *TradeCorrectionQuery

QueryCorrection queries the "correction" edge of the TradeRecord entity.

func (*TradeRecord) QueryExchange

func (tr *TradeRecord) QueryExchange() *ExchangeQuery

QueryExchange queries the "exchange" edge of the TradeRecord entity.

func (*TradeRecord) QueryTimeRange

func (tr *TradeRecord) QueryTimeRange() *TradeTimeRangeQuery

QueryTimeRange queries the "time_range" edge of the TradeRecord entity.

func (*TradeRecord) String

func (tr *TradeRecord) String() string

String implements the fmt.Stringer.

func (*TradeRecord) Unwrap

func (tr *TradeRecord) Unwrap() *TradeRecord

Unwrap unwraps the TradeRecord 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 (*TradeRecord) Update

func (tr *TradeRecord) Update() *TradeRecordUpdateOne

Update returns a builder for updating this TradeRecord. Note that you need to call TradeRecord.Unwrap() before calling this method if this TradeRecord was returned from a transaction, and the transaction was committed or rolled back.

type TradeRecordClient

type TradeRecordClient struct {
	// contains filtered or unexported fields
}

TradeRecordClient is a client for the TradeRecord schema.

func NewTradeRecordClient

func NewTradeRecordClient(c config) *TradeRecordClient

NewTradeRecordClient returns a client for the TradeRecord from the given config.

func (*TradeRecordClient) Create

func (c *TradeRecordClient) Create() *TradeRecordCreate

Create returns a builder for creating a TradeRecord entity.

func (*TradeRecordClient) CreateBulk

func (c *TradeRecordClient) CreateBulk(builders ...*TradeRecordCreate) *TradeRecordCreateBulk

CreateBulk returns a builder for creating a bulk of TradeRecord entities.

func (*TradeRecordClient) Delete

func (c *TradeRecordClient) Delete() *TradeRecordDelete

Delete returns a delete builder for TradeRecord.

func (*TradeRecordClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TradeRecordClient) DeleteOneID

func (c *TradeRecordClient) DeleteOneID(id int) *TradeRecordDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*TradeRecordClient) Get

func (c *TradeRecordClient) Get(ctx context.Context, id int) (*TradeRecord, error)

Get returns a TradeRecord entity by its id.

func (*TradeRecordClient) GetX

func (c *TradeRecordClient) GetX(ctx context.Context, id int) *TradeRecord

GetX is like Get, but panics if an error occurs.

func (*TradeRecordClient) Hooks

func (c *TradeRecordClient) Hooks() []Hook

Hooks returns the client hooks.

func (*TradeRecordClient) Intercept

func (c *TradeRecordClient) Intercept(interceptors ...Interceptor)

Use adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `traderecord.Intercept(f(g(h())))`.

func (*TradeRecordClient) Interceptors

func (c *TradeRecordClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*TradeRecordClient) Query

func (c *TradeRecordClient) Query() *TradeRecordQuery

Query returns a query builder for TradeRecord.

func (*TradeRecordClient) QueryConditions

func (c *TradeRecordClient) QueryConditions(tr *TradeRecord) *TradeConditionQuery

QueryConditions queries the conditions edge of a TradeRecord.

func (*TradeRecordClient) QueryCorrection

func (c *TradeRecordClient) QueryCorrection(tr *TradeRecord) *TradeCorrectionQuery

QueryCorrection queries the correction edge of a TradeRecord.

func (*TradeRecordClient) QueryExchange

func (c *TradeRecordClient) QueryExchange(tr *TradeRecord) *ExchangeQuery

QueryExchange queries the exchange edge of a TradeRecord.

func (*TradeRecordClient) QueryTimeRange

func (c *TradeRecordClient) QueryTimeRange(tr *TradeRecord) *TradeTimeRangeQuery

QueryTimeRange queries the time_range edge of a TradeRecord.

func (*TradeRecordClient) Update

func (c *TradeRecordClient) Update() *TradeRecordUpdate

Update returns an update builder for TradeRecord.

func (*TradeRecordClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*TradeRecordClient) UpdateOneID

func (c *TradeRecordClient) UpdateOneID(id int) *TradeRecordUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TradeRecordClient) Use

func (c *TradeRecordClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `traderecord.Hooks(f(g(h())))`.

type TradeRecordCreate

type TradeRecordCreate struct {
	// contains filtered or unexported fields
}

TradeRecordCreate is the builder for creating a TradeRecord entity.

func (*TradeRecordCreate) AddConditionIDs

func (trc *TradeRecordCreate) AddConditionIDs(ids ...int) *TradeRecordCreate

AddConditionIDs adds the "conditions" edge to the TradeCondition entity by IDs.

func (*TradeRecordCreate) AddConditions

func (trc *TradeRecordCreate) AddConditions(t ...*TradeCondition) *TradeRecordCreate

AddConditions adds the "conditions" edges to the TradeCondition entity.

func (*TradeRecordCreate) AddCorrection

func (trc *TradeRecordCreate) AddCorrection(t ...*TradeCorrection) *TradeRecordCreate

AddCorrection adds the "correction" edges to the TradeCorrection entity.

func (*TradeRecordCreate) AddCorrectionIDs

func (trc *TradeRecordCreate) AddCorrectionIDs(ids ...int) *TradeRecordCreate

AddCorrectionIDs adds the "correction" edge to the TradeCorrection entity by IDs.

func (*TradeRecordCreate) AddExchange

func (trc *TradeRecordCreate) AddExchange(e ...*Exchange) *TradeRecordCreate

AddExchange adds the "exchange" edges to the Exchange entity.

func (*TradeRecordCreate) AddExchangeIDs

func (trc *TradeRecordCreate) AddExchangeIDs(ids ...int) *TradeRecordCreate

AddExchangeIDs adds the "exchange" edge to the Exchange entity by IDs.

func (*TradeRecordCreate) Exec

func (trc *TradeRecordCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TradeRecordCreate) ExecX

func (trc *TradeRecordCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TradeRecordCreate) Mutation

func (trc *TradeRecordCreate) Mutation() *TradeRecordMutation

Mutation returns the TradeRecordMutation object of the builder.

func (*TradeRecordCreate) Save

func (trc *TradeRecordCreate) Save(ctx context.Context) (*TradeRecord, error)

Save creates the TradeRecord in the database.

func (*TradeRecordCreate) SaveX

func (trc *TradeRecordCreate) SaveX(ctx context.Context) *TradeRecord

SaveX calls Save and panics if Save returns an error.

func (*TradeRecordCreate) SetPrice

func (trc *TradeRecordCreate) SetPrice(f float64) *TradeRecordCreate

SetPrice sets the "price" field.

func (*TradeRecordCreate) SetTimeRange

func (trc *TradeRecordCreate) SetTimeRange(t *TradeTimeRange) *TradeRecordCreate

SetTimeRange sets the "time_range" edge to the TradeTimeRange entity.

func (*TradeRecordCreate) SetTimeRangeID

func (trc *TradeRecordCreate) SetTimeRangeID(i int) *TradeRecordCreate

SetTimeRangeID sets the "time_range_id" field.

func (*TradeRecordCreate) SetTimestamp

func (trc *TradeRecordCreate) SetTimestamp(t time.Time) *TradeRecordCreate

SetTimestamp sets the "timestamp" field.

func (*TradeRecordCreate) SetVolume

func (trc *TradeRecordCreate) SetVolume(i int32) *TradeRecordCreate

SetVolume sets the "volume" field.

type TradeRecordCreateBulk

type TradeRecordCreateBulk struct {
	// contains filtered or unexported fields
}

TradeRecordCreateBulk is the builder for creating many TradeRecord entities in bulk.

func (*TradeRecordCreateBulk) Exec

func (trcb *TradeRecordCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TradeRecordCreateBulk) ExecX

func (trcb *TradeRecordCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TradeRecordCreateBulk) Save

func (trcb *TradeRecordCreateBulk) Save(ctx context.Context) ([]*TradeRecord, error)

Save creates the TradeRecord entities in the database.

func (*TradeRecordCreateBulk) SaveX

func (trcb *TradeRecordCreateBulk) SaveX(ctx context.Context) []*TradeRecord

SaveX is like Save, but panics if an error occurs.

type TradeRecordDelete

type TradeRecordDelete struct {
	// contains filtered or unexported fields
}

TradeRecordDelete is the builder for deleting a TradeRecord entity.

func (*TradeRecordDelete) Exec

func (trd *TradeRecordDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*TradeRecordDelete) ExecX

func (trd *TradeRecordDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*TradeRecordDelete) Where

Where appends a list predicates to the TradeRecordDelete builder.

type TradeRecordDeleteOne

type TradeRecordDeleteOne struct {
	// contains filtered or unexported fields
}

TradeRecordDeleteOne is the builder for deleting a single TradeRecord entity.

func (*TradeRecordDeleteOne) Exec

func (trdo *TradeRecordDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TradeRecordDeleteOne) ExecX

func (trdo *TradeRecordDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type TradeRecordEdges

type TradeRecordEdges struct {
	// TimeRange holds the value of the time_range edge.
	TimeRange *TradeTimeRange `json:"time_range,omitempty"`
	// Conditions holds the value of the conditions edge.
	Conditions []*TradeCondition `json:"conditions,omitempty"`
	// Correction holds the value of the correction edge.
	Correction []*TradeCorrection `json:"correction,omitempty"`
	// Exchange holds the value of the exchange edge.
	Exchange []*Exchange `json:"exchange,omitempty"`
	// contains filtered or unexported fields
}

TradeRecordEdges holds the relations/edges for other nodes in the graph.

func (TradeRecordEdges) ConditionsOrErr

func (e TradeRecordEdges) ConditionsOrErr() ([]*TradeCondition, error)

ConditionsOrErr returns the Conditions value or an error if the edge was not loaded in eager-loading.

func (TradeRecordEdges) CorrectionOrErr

func (e TradeRecordEdges) CorrectionOrErr() ([]*TradeCorrection, error)

CorrectionOrErr returns the Correction value or an error if the edge was not loaded in eager-loading.

func (TradeRecordEdges) ExchangeOrErr

func (e TradeRecordEdges) ExchangeOrErr() ([]*Exchange, error)

ExchangeOrErr returns the Exchange value or an error if the edge was not loaded in eager-loading.

func (TradeRecordEdges) TimeRangeOrErr

func (e TradeRecordEdges) TimeRangeOrErr() (*TradeTimeRange, error)

TimeRangeOrErr returns the TimeRange value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type TradeRecordGroupBy

type TradeRecordGroupBy struct {
	// contains filtered or unexported fields
}

TradeRecordGroupBy is the group-by builder for TradeRecord entities.

func (*TradeRecordGroupBy) Aggregate

func (trgb *TradeRecordGroupBy) Aggregate(fns ...AggregateFunc) *TradeRecordGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*TradeRecordGroupBy) Bool

func (s *TradeRecordGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TradeRecordGroupBy) BoolX

func (s *TradeRecordGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TradeRecordGroupBy) Bools

func (s *TradeRecordGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TradeRecordGroupBy) BoolsX

func (s *TradeRecordGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TradeRecordGroupBy) Float64

func (s *TradeRecordGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TradeRecordGroupBy) Float64X

func (s *TradeRecordGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TradeRecordGroupBy) Float64s

func (s *TradeRecordGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TradeRecordGroupBy) Float64sX

func (s *TradeRecordGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TradeRecordGroupBy) Int

func (s *TradeRecordGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TradeRecordGroupBy) IntX

func (s *TradeRecordGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TradeRecordGroupBy) Ints

func (s *TradeRecordGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TradeRecordGroupBy) IntsX

func (s *TradeRecordGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TradeRecordGroupBy) Scan

func (trgb *TradeRecordGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TradeRecordGroupBy) ScanX

func (s *TradeRecordGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TradeRecordGroupBy) String

func (s *TradeRecordGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TradeRecordGroupBy) StringX

func (s *TradeRecordGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TradeRecordGroupBy) Strings

func (s *TradeRecordGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TradeRecordGroupBy) StringsX

func (s *TradeRecordGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TradeRecordMutation

type TradeRecordMutation struct {
	// contains filtered or unexported fields
}

TradeRecordMutation represents an operation that mutates the TradeRecord nodes in the graph.

func (*TradeRecordMutation) AddConditionIDs

func (m *TradeRecordMutation) AddConditionIDs(ids ...int)

AddConditionIDs adds the "conditions" edge to the TradeCondition entity by ids.

func (*TradeRecordMutation) AddCorrectionIDs

func (m *TradeRecordMutation) AddCorrectionIDs(ids ...int)

AddCorrectionIDs adds the "correction" edge to the TradeCorrection entity by ids.

func (*TradeRecordMutation) AddExchangeIDs

func (m *TradeRecordMutation) AddExchangeIDs(ids ...int)

AddExchangeIDs adds the "exchange" edge to the Exchange entity by ids.

func (*TradeRecordMutation) AddField

func (m *TradeRecordMutation) 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 (*TradeRecordMutation) AddPrice

func (m *TradeRecordMutation) AddPrice(f float64)

AddPrice adds f to the "price" field.

func (*TradeRecordMutation) AddVolume

func (m *TradeRecordMutation) AddVolume(i int32)

AddVolume adds i to the "volume" field.

func (*TradeRecordMutation) AddedEdges

func (m *TradeRecordMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*TradeRecordMutation) AddedField

func (m *TradeRecordMutation) 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 (*TradeRecordMutation) AddedFields

func (m *TradeRecordMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*TradeRecordMutation) AddedIDs

func (m *TradeRecordMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*TradeRecordMutation) AddedPrice

func (m *TradeRecordMutation) AddedPrice() (r float64, exists bool)

AddedPrice returns the value that was added to the "price" field in this mutation.

func (*TradeRecordMutation) AddedVolume

func (m *TradeRecordMutation) AddedVolume() (r int32, exists bool)

AddedVolume returns the value that was added to the "volume" field in this mutation.

func (*TradeRecordMutation) ClearConditions

func (m *TradeRecordMutation) ClearConditions()

ClearConditions clears the "conditions" edge to the TradeCondition entity.

func (*TradeRecordMutation) ClearCorrection

func (m *TradeRecordMutation) ClearCorrection()

ClearCorrection clears the "correction" edge to the TradeCorrection entity.

func (*TradeRecordMutation) ClearEdge

func (m *TradeRecordMutation) 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 (*TradeRecordMutation) ClearExchange

func (m *TradeRecordMutation) ClearExchange()

ClearExchange clears the "exchange" edge to the Exchange entity.

func (*TradeRecordMutation) ClearField

func (m *TradeRecordMutation) 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 (*TradeRecordMutation) ClearTimeRange

func (m *TradeRecordMutation) ClearTimeRange()

ClearTimeRange clears the "time_range" edge to the TradeTimeRange entity.

func (*TradeRecordMutation) ClearedEdges

func (m *TradeRecordMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*TradeRecordMutation) ClearedFields

func (m *TradeRecordMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (TradeRecordMutation) Client

func (m TradeRecordMutation) 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 (*TradeRecordMutation) ConditionsCleared

func (m *TradeRecordMutation) ConditionsCleared() bool

ConditionsCleared reports if the "conditions" edge to the TradeCondition entity was cleared.

func (*TradeRecordMutation) ConditionsIDs

func (m *TradeRecordMutation) ConditionsIDs() (ids []int)

ConditionsIDs returns the "conditions" edge IDs in the mutation.

func (*TradeRecordMutation) CorrectionCleared

func (m *TradeRecordMutation) CorrectionCleared() bool

CorrectionCleared reports if the "correction" edge to the TradeCorrection entity was cleared.

func (*TradeRecordMutation) CorrectionIDs

func (m *TradeRecordMutation) CorrectionIDs() (ids []int)

CorrectionIDs returns the "correction" edge IDs in the mutation.

func (*TradeRecordMutation) EdgeCleared

func (m *TradeRecordMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*TradeRecordMutation) ExchangeCleared

func (m *TradeRecordMutation) ExchangeCleared() bool

ExchangeCleared reports if the "exchange" edge to the Exchange entity was cleared.

func (*TradeRecordMutation) ExchangeIDs

func (m *TradeRecordMutation) ExchangeIDs() (ids []int)

ExchangeIDs returns the "exchange" edge IDs in the mutation.

func (*TradeRecordMutation) Field

func (m *TradeRecordMutation) 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 (*TradeRecordMutation) FieldCleared

func (m *TradeRecordMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*TradeRecordMutation) Fields

func (m *TradeRecordMutation) 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 (*TradeRecordMutation) ID

func (m *TradeRecordMutation) 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 (*TradeRecordMutation) IDs

func (m *TradeRecordMutation) 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 (*TradeRecordMutation) OldField

func (m *TradeRecordMutation) 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 (*TradeRecordMutation) OldPrice

func (m *TradeRecordMutation) OldPrice(ctx context.Context) (v float64, err error)

OldPrice returns the old "price" field's value of the TradeRecord entity. If the TradeRecord 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 (*TradeRecordMutation) OldTimeRangeID

func (m *TradeRecordMutation) OldTimeRangeID(ctx context.Context) (v int, err error)

OldTimeRangeID returns the old "time_range_id" field's value of the TradeRecord entity. If the TradeRecord 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 (*TradeRecordMutation) OldTimestamp

func (m *TradeRecordMutation) OldTimestamp(ctx context.Context) (v time.Time, err error)

OldTimestamp returns the old "timestamp" field's value of the TradeRecord entity. If the TradeRecord 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 (*TradeRecordMutation) OldVolume

func (m *TradeRecordMutation) OldVolume(ctx context.Context) (v int32, err error)

OldVolume returns the old "volume" field's value of the TradeRecord entity. If the TradeRecord 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 (*TradeRecordMutation) Op

func (m *TradeRecordMutation) Op() Op

Op returns the operation name.

func (*TradeRecordMutation) Price

func (m *TradeRecordMutation) Price() (r float64, exists bool)

Price returns the value of the "price" field in the mutation.

func (*TradeRecordMutation) RemoveConditionIDs

func (m *TradeRecordMutation) RemoveConditionIDs(ids ...int)

RemoveConditionIDs removes the "conditions" edge to the TradeCondition entity by IDs.

func (*TradeRecordMutation) RemoveCorrectionIDs

func (m *TradeRecordMutation) RemoveCorrectionIDs(ids ...int)

RemoveCorrectionIDs removes the "correction" edge to the TradeCorrection entity by IDs.

func (*TradeRecordMutation) RemoveExchangeIDs

func (m *TradeRecordMutation) RemoveExchangeIDs(ids ...int)

RemoveExchangeIDs removes the "exchange" edge to the Exchange entity by IDs.

func (*TradeRecordMutation) RemovedConditionsIDs

func (m *TradeRecordMutation) RemovedConditionsIDs() (ids []int)

RemovedConditions returns the removed IDs of the "conditions" edge to the TradeCondition entity.

func (*TradeRecordMutation) RemovedCorrectionIDs

func (m *TradeRecordMutation) RemovedCorrectionIDs() (ids []int)

RemovedCorrection returns the removed IDs of the "correction" edge to the TradeCorrection entity.

func (*TradeRecordMutation) RemovedEdges

func (m *TradeRecordMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*TradeRecordMutation) RemovedExchangeIDs

func (m *TradeRecordMutation) RemovedExchangeIDs() (ids []int)

RemovedExchange returns the removed IDs of the "exchange" edge to the Exchange entity.

func (*TradeRecordMutation) RemovedIDs

func (m *TradeRecordMutation) 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 (*TradeRecordMutation) ResetConditions

func (m *TradeRecordMutation) ResetConditions()

ResetConditions resets all changes to the "conditions" edge.

func (*TradeRecordMutation) ResetCorrection

func (m *TradeRecordMutation) ResetCorrection()

ResetCorrection resets all changes to the "correction" edge.

func (*TradeRecordMutation) ResetEdge

func (m *TradeRecordMutation) 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 (*TradeRecordMutation) ResetExchange

func (m *TradeRecordMutation) ResetExchange()

ResetExchange resets all changes to the "exchange" edge.

func (*TradeRecordMutation) ResetField

func (m *TradeRecordMutation) 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 (*TradeRecordMutation) ResetPrice

func (m *TradeRecordMutation) ResetPrice()

ResetPrice resets all changes to the "price" field.

func (*TradeRecordMutation) ResetTimeRange

func (m *TradeRecordMutation) ResetTimeRange()

ResetTimeRange resets all changes to the "time_range" edge.

func (*TradeRecordMutation) ResetTimeRangeID

func (m *TradeRecordMutation) ResetTimeRangeID()

ResetTimeRangeID resets all changes to the "time_range_id" field.

func (*TradeRecordMutation) ResetTimestamp

func (m *TradeRecordMutation) ResetTimestamp()

ResetTimestamp resets all changes to the "timestamp" field.

func (*TradeRecordMutation) ResetVolume

func (m *TradeRecordMutation) ResetVolume()

ResetVolume resets all changes to the "volume" field.

func (*TradeRecordMutation) SetField

func (m *TradeRecordMutation) 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 (*TradeRecordMutation) SetOp

func (m *TradeRecordMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*TradeRecordMutation) SetPrice

func (m *TradeRecordMutation) SetPrice(f float64)

SetPrice sets the "price" field.

func (*TradeRecordMutation) SetTimeRangeID

func (m *TradeRecordMutation) SetTimeRangeID(i int)

SetTimeRangeID sets the "time_range_id" field.

func (*TradeRecordMutation) SetTimestamp

func (m *TradeRecordMutation) SetTimestamp(t time.Time)

SetTimestamp sets the "timestamp" field.

func (*TradeRecordMutation) SetVolume

func (m *TradeRecordMutation) SetVolume(i int32)

SetVolume sets the "volume" field.

func (*TradeRecordMutation) TimeRangeCleared

func (m *TradeRecordMutation) TimeRangeCleared() bool

TimeRangeCleared reports if the "time_range" edge to the TradeTimeRange entity was cleared.

func (*TradeRecordMutation) TimeRangeID

func (m *TradeRecordMutation) TimeRangeID() (r int, exists bool)

TimeRangeID returns the value of the "time_range_id" field in the mutation.

func (*TradeRecordMutation) TimeRangeIDs

func (m *TradeRecordMutation) TimeRangeIDs() (ids []int)

TimeRangeIDs returns the "time_range" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use TimeRangeID instead. It exists only for internal usage by the builders.

func (*TradeRecordMutation) Timestamp

func (m *TradeRecordMutation) Timestamp() (r time.Time, exists bool)

Timestamp returns the value of the "timestamp" field in the mutation.

func (TradeRecordMutation) Tx

func (m TradeRecordMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*TradeRecordMutation) Type

func (m *TradeRecordMutation) Type() string

Type returns the node type of this mutation (TradeRecord).

func (*TradeRecordMutation) Volume

func (m *TradeRecordMutation) Volume() (r int32, exists bool)

Volume returns the value of the "volume" field in the mutation.

func (*TradeRecordMutation) Where

func (m *TradeRecordMutation) Where(ps ...predicate.TradeRecord)

Where appends a list predicates to the TradeRecordMutation builder.

func (*TradeRecordMutation) WhereP

func (m *TradeRecordMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the TradeRecordMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type TradeRecordQuery

type TradeRecordQuery struct {
	// contains filtered or unexported fields
}

TradeRecordQuery is the builder for querying TradeRecord entities.

func (*TradeRecordQuery) Aggregate

func (trq *TradeRecordQuery) Aggregate(fns ...AggregateFunc) *TradeRecordSelect

Aggregate returns a TradeRecordSelect configured with the given aggregations.

func (*TradeRecordQuery) All

func (trq *TradeRecordQuery) All(ctx context.Context) ([]*TradeRecord, error)

All executes the query and returns a list of TradeRecords.

func (*TradeRecordQuery) AllX

func (trq *TradeRecordQuery) AllX(ctx context.Context) []*TradeRecord

AllX is like All, but panics if an error occurs.

func (*TradeRecordQuery) Clone

func (trq *TradeRecordQuery) Clone() *TradeRecordQuery

Clone returns a duplicate of the TradeRecordQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*TradeRecordQuery) Count

func (trq *TradeRecordQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TradeRecordQuery) CountX

func (trq *TradeRecordQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*TradeRecordQuery) Exist

func (trq *TradeRecordQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*TradeRecordQuery) ExistX

func (trq *TradeRecordQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*TradeRecordQuery) First

func (trq *TradeRecordQuery) First(ctx context.Context) (*TradeRecord, error)

First returns the first TradeRecord entity from the query. Returns a *NotFoundError when no TradeRecord was found.

func (*TradeRecordQuery) FirstID

func (trq *TradeRecordQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first TradeRecord ID from the query. Returns a *NotFoundError when no TradeRecord ID was found.

func (*TradeRecordQuery) FirstIDX

func (trq *TradeRecordQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*TradeRecordQuery) FirstX

func (trq *TradeRecordQuery) FirstX(ctx context.Context) *TradeRecord

FirstX is like First, but panics if an error occurs.

func (*TradeRecordQuery) GroupBy

func (trq *TradeRecordQuery) GroupBy(field string, fields ...string) *TradeRecordGroupBy

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 {
	Price float64 `json:"price,omitempty"`
	Count int `json:"count,omitempty"`
}

client.TradeRecord.Query().
	GroupBy(traderecord.FieldPrice).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TradeRecordQuery) IDs

func (trq *TradeRecordQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of TradeRecord IDs.

func (*TradeRecordQuery) IDsX

func (trq *TradeRecordQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*TradeRecordQuery) Limit

func (trq *TradeRecordQuery) Limit(limit int) *TradeRecordQuery

Limit the number of records to be returned by this query.

func (*TradeRecordQuery) Offset

func (trq *TradeRecordQuery) Offset(offset int) *TradeRecordQuery

Offset to start from.

func (*TradeRecordQuery) Only

func (trq *TradeRecordQuery) Only(ctx context.Context) (*TradeRecord, error)

Only returns a single TradeRecord entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one TradeRecord entity is found. Returns a *NotFoundError when no TradeRecord entities are found.

func (*TradeRecordQuery) OnlyID

func (trq *TradeRecordQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only TradeRecord ID in the query. Returns a *NotSingularError when more than one TradeRecord ID is found. Returns a *NotFoundError when no entities are found.

func (*TradeRecordQuery) OnlyIDX

func (trq *TradeRecordQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*TradeRecordQuery) OnlyX

func (trq *TradeRecordQuery) OnlyX(ctx context.Context) *TradeRecord

OnlyX is like Only, but panics if an error occurs.

func (*TradeRecordQuery) Order

func (trq *TradeRecordQuery) Order(o ...OrderFunc) *TradeRecordQuery

Order specifies how the records should be ordered.

func (*TradeRecordQuery) QueryConditions

func (trq *TradeRecordQuery) QueryConditions() *TradeConditionQuery

QueryConditions chains the current query on the "conditions" edge.

func (*TradeRecordQuery) QueryCorrection

func (trq *TradeRecordQuery) QueryCorrection() *TradeCorrectionQuery

QueryCorrection chains the current query on the "correction" edge.

func (*TradeRecordQuery) QueryExchange

func (trq *TradeRecordQuery) QueryExchange() *ExchangeQuery

QueryExchange chains the current query on the "exchange" edge.

func (*TradeRecordQuery) QueryTimeRange

func (trq *TradeRecordQuery) QueryTimeRange() *TradeTimeRangeQuery

QueryTimeRange chains the current query on the "time_range" edge.

func (*TradeRecordQuery) Select

func (trq *TradeRecordQuery) Select(fields ...string) *TradeRecordSelect

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 {
	Price float64 `json:"price,omitempty"`
}

client.TradeRecord.Query().
	Select(traderecord.FieldPrice).
	Scan(ctx, &v)

func (*TradeRecordQuery) Unique

func (trq *TradeRecordQuery) Unique(unique bool) *TradeRecordQuery

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 (*TradeRecordQuery) Where

Where adds a new predicate for the TradeRecordQuery builder.

func (*TradeRecordQuery) WithConditions

func (trq *TradeRecordQuery) WithConditions(opts ...func(*TradeConditionQuery)) *TradeRecordQuery

WithConditions tells the query-builder to eager-load the nodes that are connected to the "conditions" edge. The optional arguments are used to configure the query builder of the edge.

func (*TradeRecordQuery) WithCorrection

func (trq *TradeRecordQuery) WithCorrection(opts ...func(*TradeCorrectionQuery)) *TradeRecordQuery

WithCorrection tells the query-builder to eager-load the nodes that are connected to the "correction" edge. The optional arguments are used to configure the query builder of the edge.

func (*TradeRecordQuery) WithExchange

func (trq *TradeRecordQuery) WithExchange(opts ...func(*ExchangeQuery)) *TradeRecordQuery

WithExchange tells the query-builder to eager-load the nodes that are connected to the "exchange" edge. The optional arguments are used to configure the query builder of the edge.

func (*TradeRecordQuery) WithTimeRange

func (trq *TradeRecordQuery) WithTimeRange(opts ...func(*TradeTimeRangeQuery)) *TradeRecordQuery

WithTimeRange tells the query-builder to eager-load the nodes that are connected to the "time_range" edge. The optional arguments are used to configure the query builder of the edge.

type TradeRecordSelect

type TradeRecordSelect struct {
	*TradeRecordQuery
	// contains filtered or unexported fields
}

TradeRecordSelect is the builder for selecting fields of TradeRecord entities.

func (*TradeRecordSelect) Aggregate

func (trs *TradeRecordSelect) Aggregate(fns ...AggregateFunc) *TradeRecordSelect

Aggregate adds the given aggregation functions to the selector query.

func (*TradeRecordSelect) Bool

func (s *TradeRecordSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TradeRecordSelect) BoolX

func (s *TradeRecordSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TradeRecordSelect) Bools

func (s *TradeRecordSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TradeRecordSelect) BoolsX

func (s *TradeRecordSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TradeRecordSelect) Float64

func (s *TradeRecordSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TradeRecordSelect) Float64X

func (s *TradeRecordSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TradeRecordSelect) Float64s

func (s *TradeRecordSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TradeRecordSelect) Float64sX

func (s *TradeRecordSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TradeRecordSelect) Int

func (s *TradeRecordSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TradeRecordSelect) IntX

func (s *TradeRecordSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TradeRecordSelect) Ints

func (s *TradeRecordSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TradeRecordSelect) IntsX

func (s *TradeRecordSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TradeRecordSelect) Scan

func (trs *TradeRecordSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TradeRecordSelect) ScanX

func (s *TradeRecordSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TradeRecordSelect) String

func (s *TradeRecordSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TradeRecordSelect) StringX

func (s *TradeRecordSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TradeRecordSelect) Strings

func (s *TradeRecordSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TradeRecordSelect) StringsX

func (s *TradeRecordSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TradeRecordUpdate

type TradeRecordUpdate struct {
	// contains filtered or unexported fields
}

TradeRecordUpdate is the builder for updating TradeRecord entities.

func (*TradeRecordUpdate) AddConditionIDs

func (tru *TradeRecordUpdate) AddConditionIDs(ids ...int) *TradeRecordUpdate

AddConditionIDs adds the "conditions" edge to the TradeCondition entity by IDs.

func (*TradeRecordUpdate) AddConditions

func (tru *TradeRecordUpdate) AddConditions(t ...*TradeCondition) *TradeRecordUpdate

AddConditions adds the "conditions" edges to the TradeCondition entity.

func (*TradeRecordUpdate) AddCorrection

func (tru *TradeRecordUpdate) AddCorrection(t ...*TradeCorrection) *TradeRecordUpdate

AddCorrection adds the "correction" edges to the TradeCorrection entity.

func (*TradeRecordUpdate) AddCorrectionIDs

func (tru *TradeRecordUpdate) AddCorrectionIDs(ids ...int) *TradeRecordUpdate

AddCorrectionIDs adds the "correction" edge to the TradeCorrection entity by IDs.

func (*TradeRecordUpdate) AddExchange

func (tru *TradeRecordUpdate) AddExchange(e ...*Exchange) *TradeRecordUpdate

AddExchange adds the "exchange" edges to the Exchange entity.

func (*TradeRecordUpdate) AddExchangeIDs

func (tru *TradeRecordUpdate) AddExchangeIDs(ids ...int) *TradeRecordUpdate

AddExchangeIDs adds the "exchange" edge to the Exchange entity by IDs.

func (*TradeRecordUpdate) AddPrice

func (tru *TradeRecordUpdate) AddPrice(f float64) *TradeRecordUpdate

AddPrice adds f to the "price" field.

func (*TradeRecordUpdate) AddVolume

func (tru *TradeRecordUpdate) AddVolume(i int32) *TradeRecordUpdate

AddVolume adds i to the "volume" field.

func (*TradeRecordUpdate) ClearConditions

func (tru *TradeRecordUpdate) ClearConditions() *TradeRecordUpdate

ClearConditions clears all "conditions" edges to the TradeCondition entity.

func (*TradeRecordUpdate) ClearCorrection

func (tru *TradeRecordUpdate) ClearCorrection() *TradeRecordUpdate

ClearCorrection clears all "correction" edges to the TradeCorrection entity.

func (*TradeRecordUpdate) ClearExchange

func (tru *TradeRecordUpdate) ClearExchange() *TradeRecordUpdate

ClearExchange clears all "exchange" edges to the Exchange entity.

func (*TradeRecordUpdate) ClearTimeRange

func (tru *TradeRecordUpdate) ClearTimeRange() *TradeRecordUpdate

ClearTimeRange clears the "time_range" edge to the TradeTimeRange entity.

func (*TradeRecordUpdate) Exec

func (tru *TradeRecordUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TradeRecordUpdate) ExecX

func (tru *TradeRecordUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TradeRecordUpdate) Mutation

func (tru *TradeRecordUpdate) Mutation() *TradeRecordMutation

Mutation returns the TradeRecordMutation object of the builder.

func (*TradeRecordUpdate) RemoveConditionIDs

func (tru *TradeRecordUpdate) RemoveConditionIDs(ids ...int) *TradeRecordUpdate

RemoveConditionIDs removes the "conditions" edge to TradeCondition entities by IDs.

func (*TradeRecordUpdate) RemoveConditions

func (tru *TradeRecordUpdate) RemoveConditions(t ...*TradeCondition) *TradeRecordUpdate

RemoveConditions removes "conditions" edges to TradeCondition entities.

func (*TradeRecordUpdate) RemoveCorrection

func (tru *TradeRecordUpdate) RemoveCorrection(t ...*TradeCorrection) *TradeRecordUpdate

RemoveCorrection removes "correction" edges to TradeCorrection entities.

func (*TradeRecordUpdate) RemoveCorrectionIDs

func (tru *TradeRecordUpdate) RemoveCorrectionIDs(ids ...int) *TradeRecordUpdate

RemoveCorrectionIDs removes the "correction" edge to TradeCorrection entities by IDs.

func (*TradeRecordUpdate) RemoveExchange

func (tru *TradeRecordUpdate) RemoveExchange(e ...*Exchange) *TradeRecordUpdate

RemoveExchange removes "exchange" edges to Exchange entities.

func (*TradeRecordUpdate) RemoveExchangeIDs

func (tru *TradeRecordUpdate) RemoveExchangeIDs(ids ...int) *TradeRecordUpdate

RemoveExchangeIDs removes the "exchange" edge to Exchange entities by IDs.

func (*TradeRecordUpdate) Save

func (tru *TradeRecordUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*TradeRecordUpdate) SaveX

func (tru *TradeRecordUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*TradeRecordUpdate) SetPrice

func (tru *TradeRecordUpdate) SetPrice(f float64) *TradeRecordUpdate

SetPrice sets the "price" field.

func (*TradeRecordUpdate) SetTimeRange

func (tru *TradeRecordUpdate) SetTimeRange(t *TradeTimeRange) *TradeRecordUpdate

SetTimeRange sets the "time_range" edge to the TradeTimeRange entity.

func (*TradeRecordUpdate) SetTimeRangeID

func (tru *TradeRecordUpdate) SetTimeRangeID(i int) *TradeRecordUpdate

SetTimeRangeID sets the "time_range_id" field.

func (*TradeRecordUpdate) SetTimestamp

func (tru *TradeRecordUpdate) SetTimestamp(t time.Time) *TradeRecordUpdate

SetTimestamp sets the "timestamp" field.

func (*TradeRecordUpdate) SetVolume

func (tru *TradeRecordUpdate) SetVolume(i int32) *TradeRecordUpdate

SetVolume sets the "volume" field.

func (*TradeRecordUpdate) Where

Where appends a list predicates to the TradeRecordUpdate builder.

type TradeRecordUpdateOne

type TradeRecordUpdateOne struct {
	// contains filtered or unexported fields
}

TradeRecordUpdateOne is the builder for updating a single TradeRecord entity.

func (*TradeRecordUpdateOne) AddConditionIDs

func (truo *TradeRecordUpdateOne) AddConditionIDs(ids ...int) *TradeRecordUpdateOne

AddConditionIDs adds the "conditions" edge to the TradeCondition entity by IDs.

func (*TradeRecordUpdateOne) AddConditions

func (truo *TradeRecordUpdateOne) AddConditions(t ...*TradeCondition) *TradeRecordUpdateOne

AddConditions adds the "conditions" edges to the TradeCondition entity.

func (*TradeRecordUpdateOne) AddCorrection

func (truo *TradeRecordUpdateOne) AddCorrection(t ...*TradeCorrection) *TradeRecordUpdateOne

AddCorrection adds the "correction" edges to the TradeCorrection entity.

func (*TradeRecordUpdateOne) AddCorrectionIDs

func (truo *TradeRecordUpdateOne) AddCorrectionIDs(ids ...int) *TradeRecordUpdateOne

AddCorrectionIDs adds the "correction" edge to the TradeCorrection entity by IDs.

func (*TradeRecordUpdateOne) AddExchange

func (truo *TradeRecordUpdateOne) AddExchange(e ...*Exchange) *TradeRecordUpdateOne

AddExchange adds the "exchange" edges to the Exchange entity.

func (*TradeRecordUpdateOne) AddExchangeIDs

func (truo *TradeRecordUpdateOne) AddExchangeIDs(ids ...int) *TradeRecordUpdateOne

AddExchangeIDs adds the "exchange" edge to the Exchange entity by IDs.

func (*TradeRecordUpdateOne) AddPrice

AddPrice adds f to the "price" field.

func (*TradeRecordUpdateOne) AddVolume

func (truo *TradeRecordUpdateOne) AddVolume(i int32) *TradeRecordUpdateOne

AddVolume adds i to the "volume" field.

func (*TradeRecordUpdateOne) ClearConditions

func (truo *TradeRecordUpdateOne) ClearConditions() *TradeRecordUpdateOne

ClearConditions clears all "conditions" edges to the TradeCondition entity.

func (*TradeRecordUpdateOne) ClearCorrection

func (truo *TradeRecordUpdateOne) ClearCorrection() *TradeRecordUpdateOne

ClearCorrection clears all "correction" edges to the TradeCorrection entity.

func (*TradeRecordUpdateOne) ClearExchange

func (truo *TradeRecordUpdateOne) ClearExchange() *TradeRecordUpdateOne

ClearExchange clears all "exchange" edges to the Exchange entity.

func (*TradeRecordUpdateOne) ClearTimeRange

func (truo *TradeRecordUpdateOne) ClearTimeRange() *TradeRecordUpdateOne

ClearTimeRange clears the "time_range" edge to the TradeTimeRange entity.

func (*TradeRecordUpdateOne) Exec

func (truo *TradeRecordUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TradeRecordUpdateOne) ExecX

func (truo *TradeRecordUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TradeRecordUpdateOne) Mutation

func (truo *TradeRecordUpdateOne) Mutation() *TradeRecordMutation

Mutation returns the TradeRecordMutation object of the builder.

func (*TradeRecordUpdateOne) RemoveConditionIDs

func (truo *TradeRecordUpdateOne) RemoveConditionIDs(ids ...int) *TradeRecordUpdateOne

RemoveConditionIDs removes the "conditions" edge to TradeCondition entities by IDs.

func (*TradeRecordUpdateOne) RemoveConditions

func (truo *TradeRecordUpdateOne) RemoveConditions(t ...*TradeCondition) *TradeRecordUpdateOne

RemoveConditions removes "conditions" edges to TradeCondition entities.

func (*TradeRecordUpdateOne) RemoveCorrection

func (truo *TradeRecordUpdateOne) RemoveCorrection(t ...*TradeCorrection) *TradeRecordUpdateOne

RemoveCorrection removes "correction" edges to TradeCorrection entities.

func (*TradeRecordUpdateOne) RemoveCorrectionIDs

func (truo *TradeRecordUpdateOne) RemoveCorrectionIDs(ids ...int) *TradeRecordUpdateOne

RemoveCorrectionIDs removes the "correction" edge to TradeCorrection entities by IDs.

func (*TradeRecordUpdateOne) RemoveExchange

func (truo *TradeRecordUpdateOne) RemoveExchange(e ...*Exchange) *TradeRecordUpdateOne

RemoveExchange removes "exchange" edges to Exchange entities.

func (*TradeRecordUpdateOne) RemoveExchangeIDs

func (truo *TradeRecordUpdateOne) RemoveExchangeIDs(ids ...int) *TradeRecordUpdateOne

RemoveExchangeIDs removes the "exchange" edge to Exchange entities by IDs.

func (*TradeRecordUpdateOne) Save

Save executes the query and returns the updated TradeRecord entity.

func (*TradeRecordUpdateOne) SaveX

func (truo *TradeRecordUpdateOne) SaveX(ctx context.Context) *TradeRecord

SaveX is like Save, but panics if an error occurs.

func (*TradeRecordUpdateOne) Select

func (truo *TradeRecordUpdateOne) Select(field string, fields ...string) *TradeRecordUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*TradeRecordUpdateOne) SetPrice

SetPrice sets the "price" field.

func (*TradeRecordUpdateOne) SetTimeRange

SetTimeRange sets the "time_range" edge to the TradeTimeRange entity.

func (*TradeRecordUpdateOne) SetTimeRangeID

func (truo *TradeRecordUpdateOne) SetTimeRangeID(i int) *TradeRecordUpdateOne

SetTimeRangeID sets the "time_range_id" field.

func (*TradeRecordUpdateOne) SetTimestamp

func (truo *TradeRecordUpdateOne) SetTimestamp(t time.Time) *TradeRecordUpdateOne

SetTimestamp sets the "timestamp" field.

func (*TradeRecordUpdateOne) SetVolume

func (truo *TradeRecordUpdateOne) SetVolume(i int32) *TradeRecordUpdateOne

SetVolume sets the "volume" field.

type TradeRecords

type TradeRecords []*TradeRecord

TradeRecords is a parsable slice of TradeRecord.

type TradeTimeRange

type TradeTimeRange struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Start holds the value of the "start" field.
	Start time.Time `json:"start,omitempty"`
	// End holds the value of the "end" field.
	End time.Time `json:"end,omitempty"`
	// IntervalID holds the value of the "interval_id" field.
	IntervalID int `json:"interval_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TradeTimeRangeQuery when eager-loading is set.
	Edges TradeTimeRangeEdges `json:"edges"`
	// contains filtered or unexported fields
}

TradeTimeRange is the model entity for the TradeTimeRange schema.

func (*TradeTimeRange) QueryInterval

func (ttr *TradeTimeRange) QueryInterval() *IntervalQuery

QueryInterval queries the "interval" edge of the TradeTimeRange entity.

func (*TradeTimeRange) QueryRecords

func (ttr *TradeTimeRange) QueryRecords() *TradeRecordQuery

QueryRecords queries the "records" edge of the TradeTimeRange entity.

func (*TradeTimeRange) String

func (ttr *TradeTimeRange) String() string

String implements the fmt.Stringer.

func (*TradeTimeRange) Unwrap

func (ttr *TradeTimeRange) Unwrap() *TradeTimeRange

Unwrap unwraps the TradeTimeRange 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 (*TradeTimeRange) Update

func (ttr *TradeTimeRange) Update() *TradeTimeRangeUpdateOne

Update returns a builder for updating this TradeTimeRange. Note that you need to call TradeTimeRange.Unwrap() before calling this method if this TradeTimeRange was returned from a transaction, and the transaction was committed or rolled back.

type TradeTimeRangeClient

type TradeTimeRangeClient struct {
	// contains filtered or unexported fields
}

TradeTimeRangeClient is a client for the TradeTimeRange schema.

func NewTradeTimeRangeClient

func NewTradeTimeRangeClient(c config) *TradeTimeRangeClient

NewTradeTimeRangeClient returns a client for the TradeTimeRange from the given config.

func (*TradeTimeRangeClient) Create

Create returns a builder for creating a TradeTimeRange entity.

func (*TradeTimeRangeClient) CreateBulk

CreateBulk returns a builder for creating a bulk of TradeTimeRange entities.

func (*TradeTimeRangeClient) Delete

Delete returns a delete builder for TradeTimeRange.

func (*TradeTimeRangeClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TradeTimeRangeClient) DeleteOneID

func (c *TradeTimeRangeClient) DeleteOneID(id int) *TradeTimeRangeDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*TradeTimeRangeClient) Get

Get returns a TradeTimeRange entity by its id.

func (*TradeTimeRangeClient) GetX

GetX is like Get, but panics if an error occurs.

func (*TradeTimeRangeClient) Hooks

func (c *TradeTimeRangeClient) Hooks() []Hook

Hooks returns the client hooks.

func (*TradeTimeRangeClient) Intercept

func (c *TradeTimeRangeClient) Intercept(interceptors ...Interceptor)

Use adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `tradetimerange.Intercept(f(g(h())))`.

func (*TradeTimeRangeClient) Interceptors

func (c *TradeTimeRangeClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*TradeTimeRangeClient) Query

Query returns a query builder for TradeTimeRange.

func (*TradeTimeRangeClient) QueryInterval

func (c *TradeTimeRangeClient) QueryInterval(ttr *TradeTimeRange) *IntervalQuery

QueryInterval queries the interval edge of a TradeTimeRange.

func (*TradeTimeRangeClient) QueryRecords

func (c *TradeTimeRangeClient) QueryRecords(ttr *TradeTimeRange) *TradeRecordQuery

QueryRecords queries the records edge of a TradeTimeRange.

func (*TradeTimeRangeClient) Update

Update returns an update builder for TradeTimeRange.

func (*TradeTimeRangeClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*TradeTimeRangeClient) UpdateOneID

func (c *TradeTimeRangeClient) UpdateOneID(id int) *TradeTimeRangeUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TradeTimeRangeClient) Use

func (c *TradeTimeRangeClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `tradetimerange.Hooks(f(g(h())))`.

type TradeTimeRangeCreate

type TradeTimeRangeCreate struct {
	// contains filtered or unexported fields
}

TradeTimeRangeCreate is the builder for creating a TradeTimeRange entity.

func (*TradeTimeRangeCreate) AddRecordIDs

func (ttrc *TradeTimeRangeCreate) AddRecordIDs(ids ...int) *TradeTimeRangeCreate

AddRecordIDs adds the "records" edge to the TradeRecord entity by IDs.

func (*TradeTimeRangeCreate) AddRecords

func (ttrc *TradeTimeRangeCreate) AddRecords(t ...*TradeRecord) *TradeTimeRangeCreate

AddRecords adds the "records" edges to the TradeRecord entity.

func (*TradeTimeRangeCreate) Exec

func (ttrc *TradeTimeRangeCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TradeTimeRangeCreate) ExecX

func (ttrc *TradeTimeRangeCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TradeTimeRangeCreate) Mutation

func (ttrc *TradeTimeRangeCreate) Mutation() *TradeTimeRangeMutation

Mutation returns the TradeTimeRangeMutation object of the builder.

func (*TradeTimeRangeCreate) Save

Save creates the TradeTimeRange in the database.

func (*TradeTimeRangeCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*TradeTimeRangeCreate) SetEnd

SetEnd sets the "end" field.

func (*TradeTimeRangeCreate) SetInterval

func (ttrc *TradeTimeRangeCreate) SetInterval(i *Interval) *TradeTimeRangeCreate

SetInterval sets the "interval" edge to the Interval entity.

func (*TradeTimeRangeCreate) SetIntervalID

func (ttrc *TradeTimeRangeCreate) SetIntervalID(i int) *TradeTimeRangeCreate

SetIntervalID sets the "interval_id" field.

func (*TradeTimeRangeCreate) SetStart

SetStart sets the "start" field.

type TradeTimeRangeCreateBulk

type TradeTimeRangeCreateBulk struct {
	// contains filtered or unexported fields
}

TradeTimeRangeCreateBulk is the builder for creating many TradeTimeRange entities in bulk.

func (*TradeTimeRangeCreateBulk) Exec

func (ttrcb *TradeTimeRangeCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TradeTimeRangeCreateBulk) ExecX

func (ttrcb *TradeTimeRangeCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TradeTimeRangeCreateBulk) Save

Save creates the TradeTimeRange entities in the database.

func (*TradeTimeRangeCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type TradeTimeRangeDelete

type TradeTimeRangeDelete struct {
	// contains filtered or unexported fields
}

TradeTimeRangeDelete is the builder for deleting a TradeTimeRange entity.

func (*TradeTimeRangeDelete) Exec

func (ttrd *TradeTimeRangeDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*TradeTimeRangeDelete) ExecX

func (ttrd *TradeTimeRangeDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*TradeTimeRangeDelete) Where

Where appends a list predicates to the TradeTimeRangeDelete builder.

type TradeTimeRangeDeleteOne

type TradeTimeRangeDeleteOne struct {
	// contains filtered or unexported fields
}

TradeTimeRangeDeleteOne is the builder for deleting a single TradeTimeRange entity.

func (*TradeTimeRangeDeleteOne) Exec

func (ttrdo *TradeTimeRangeDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TradeTimeRangeDeleteOne) ExecX

func (ttrdo *TradeTimeRangeDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type TradeTimeRangeEdges

type TradeTimeRangeEdges struct {
	// Interval holds the value of the interval edge.
	Interval *Interval `json:"interval,omitempty"`
	// Records holds the value of the records edge.
	Records []*TradeRecord `json:"records,omitempty"`
	// contains filtered or unexported fields
}

TradeTimeRangeEdges holds the relations/edges for other nodes in the graph.

func (TradeTimeRangeEdges) IntervalOrErr

func (e TradeTimeRangeEdges) IntervalOrErr() (*Interval, error)

IntervalOrErr returns the Interval value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (TradeTimeRangeEdges) RecordsOrErr

func (e TradeTimeRangeEdges) RecordsOrErr() ([]*TradeRecord, error)

RecordsOrErr returns the Records value or an error if the edge was not loaded in eager-loading.

type TradeTimeRangeGroupBy

type TradeTimeRangeGroupBy struct {
	// contains filtered or unexported fields
}

TradeTimeRangeGroupBy is the group-by builder for TradeTimeRange entities.

func (*TradeTimeRangeGroupBy) Aggregate

func (ttrgb *TradeTimeRangeGroupBy) Aggregate(fns ...AggregateFunc) *TradeTimeRangeGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*TradeTimeRangeGroupBy) Bool

func (s *TradeTimeRangeGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TradeTimeRangeGroupBy) BoolX

func (s *TradeTimeRangeGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TradeTimeRangeGroupBy) Bools

func (s *TradeTimeRangeGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TradeTimeRangeGroupBy) BoolsX

func (s *TradeTimeRangeGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TradeTimeRangeGroupBy) Float64

func (s *TradeTimeRangeGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TradeTimeRangeGroupBy) Float64X

func (s *TradeTimeRangeGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TradeTimeRangeGroupBy) Float64s

func (s *TradeTimeRangeGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TradeTimeRangeGroupBy) Float64sX

func (s *TradeTimeRangeGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TradeTimeRangeGroupBy) Int

func (s *TradeTimeRangeGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TradeTimeRangeGroupBy) IntX

func (s *TradeTimeRangeGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TradeTimeRangeGroupBy) Ints

func (s *TradeTimeRangeGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TradeTimeRangeGroupBy) IntsX

func (s *TradeTimeRangeGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TradeTimeRangeGroupBy) Scan

func (ttrgb *TradeTimeRangeGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TradeTimeRangeGroupBy) ScanX

func (s *TradeTimeRangeGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TradeTimeRangeGroupBy) String

func (s *TradeTimeRangeGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TradeTimeRangeGroupBy) StringX

func (s *TradeTimeRangeGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TradeTimeRangeGroupBy) Strings

func (s *TradeTimeRangeGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TradeTimeRangeGroupBy) StringsX

func (s *TradeTimeRangeGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TradeTimeRangeMutation

type TradeTimeRangeMutation struct {
	// contains filtered or unexported fields
}

TradeTimeRangeMutation represents an operation that mutates the TradeTimeRange nodes in the graph.

func (*TradeTimeRangeMutation) AddField

func (m *TradeTimeRangeMutation) 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 (*TradeTimeRangeMutation) AddRecordIDs

func (m *TradeTimeRangeMutation) AddRecordIDs(ids ...int)

AddRecordIDs adds the "records" edge to the TradeRecord entity by ids.

func (*TradeTimeRangeMutation) AddedEdges

func (m *TradeTimeRangeMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*TradeTimeRangeMutation) AddedField

func (m *TradeTimeRangeMutation) 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 (*TradeTimeRangeMutation) AddedFields

func (m *TradeTimeRangeMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*TradeTimeRangeMutation) AddedIDs

func (m *TradeTimeRangeMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*TradeTimeRangeMutation) ClearEdge

func (m *TradeTimeRangeMutation) 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 (*TradeTimeRangeMutation) ClearField

func (m *TradeTimeRangeMutation) 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 (*TradeTimeRangeMutation) ClearInterval

func (m *TradeTimeRangeMutation) ClearInterval()

ClearInterval clears the "interval" edge to the Interval entity.

func (*TradeTimeRangeMutation) ClearRecords

func (m *TradeTimeRangeMutation) ClearRecords()

ClearRecords clears the "records" edge to the TradeRecord entity.

func (*TradeTimeRangeMutation) ClearedEdges

func (m *TradeTimeRangeMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*TradeTimeRangeMutation) ClearedFields

func (m *TradeTimeRangeMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (TradeTimeRangeMutation) Client

func (m TradeTimeRangeMutation) 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 (*TradeTimeRangeMutation) EdgeCleared

func (m *TradeTimeRangeMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*TradeTimeRangeMutation) End

func (m *TradeTimeRangeMutation) End() (r time.Time, exists bool)

End returns the value of the "end" field in the mutation.

func (*TradeTimeRangeMutation) Field

func (m *TradeTimeRangeMutation) 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 (*TradeTimeRangeMutation) FieldCleared

func (m *TradeTimeRangeMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*TradeTimeRangeMutation) Fields

func (m *TradeTimeRangeMutation) 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 (*TradeTimeRangeMutation) ID

func (m *TradeTimeRangeMutation) 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 (*TradeTimeRangeMutation) IDs

func (m *TradeTimeRangeMutation) 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 (*TradeTimeRangeMutation) IntervalCleared

func (m *TradeTimeRangeMutation) IntervalCleared() bool

IntervalCleared reports if the "interval" edge to the Interval entity was cleared.

func (*TradeTimeRangeMutation) IntervalID

func (m *TradeTimeRangeMutation) IntervalID() (r int, exists bool)

IntervalID returns the value of the "interval_id" field in the mutation.

func (*TradeTimeRangeMutation) IntervalIDs

func (m *TradeTimeRangeMutation) IntervalIDs() (ids []int)

IntervalIDs returns the "interval" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use IntervalID instead. It exists only for internal usage by the builders.

func (*TradeTimeRangeMutation) OldEnd

func (m *TradeTimeRangeMutation) OldEnd(ctx context.Context) (v time.Time, err error)

OldEnd returns the old "end" field's value of the TradeTimeRange entity. If the TradeTimeRange 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 (*TradeTimeRangeMutation) OldField

func (m *TradeTimeRangeMutation) 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 (*TradeTimeRangeMutation) OldIntervalID

func (m *TradeTimeRangeMutation) OldIntervalID(ctx context.Context) (v int, err error)

OldIntervalID returns the old "interval_id" field's value of the TradeTimeRange entity. If the TradeTimeRange 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 (*TradeTimeRangeMutation) OldStart

func (m *TradeTimeRangeMutation) OldStart(ctx context.Context) (v time.Time, err error)

OldStart returns the old "start" field's value of the TradeTimeRange entity. If the TradeTimeRange 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 (*TradeTimeRangeMutation) Op

func (m *TradeTimeRangeMutation) Op() Op

Op returns the operation name.

func (*TradeTimeRangeMutation) RecordsCleared

func (m *TradeTimeRangeMutation) RecordsCleared() bool

RecordsCleared reports if the "records" edge to the TradeRecord entity was cleared.

func (*TradeTimeRangeMutation) RecordsIDs

func (m *TradeTimeRangeMutation) RecordsIDs() (ids []int)

RecordsIDs returns the "records" edge IDs in the mutation.

func (*TradeTimeRangeMutation) RemoveRecordIDs

func (m *TradeTimeRangeMutation) RemoveRecordIDs(ids ...int)

RemoveRecordIDs removes the "records" edge to the TradeRecord entity by IDs.

func (*TradeTimeRangeMutation) RemovedEdges

func (m *TradeTimeRangeMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*TradeTimeRangeMutation) RemovedIDs

func (m *TradeTimeRangeMutation) 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 (*TradeTimeRangeMutation) RemovedRecordsIDs

func (m *TradeTimeRangeMutation) RemovedRecordsIDs() (ids []int)

RemovedRecords returns the removed IDs of the "records" edge to the TradeRecord entity.

func (*TradeTimeRangeMutation) ResetEdge

func (m *TradeTimeRangeMutation) 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 (*TradeTimeRangeMutation) ResetEnd

func (m *TradeTimeRangeMutation) ResetEnd()

ResetEnd resets all changes to the "end" field.

func (*TradeTimeRangeMutation) ResetField

func (m *TradeTimeRangeMutation) 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 (*TradeTimeRangeMutation) ResetInterval

func (m *TradeTimeRangeMutation) ResetInterval()

ResetInterval resets all changes to the "interval" edge.

func (*TradeTimeRangeMutation) ResetIntervalID

func (m *TradeTimeRangeMutation) ResetIntervalID()

ResetIntervalID resets all changes to the "interval_id" field.

func (*TradeTimeRangeMutation) ResetRecords

func (m *TradeTimeRangeMutation) ResetRecords()

ResetRecords resets all changes to the "records" edge.

func (*TradeTimeRangeMutation) ResetStart

func (m *TradeTimeRangeMutation) ResetStart()

ResetStart resets all changes to the "start" field.

func (*TradeTimeRangeMutation) SetEnd

func (m *TradeTimeRangeMutation) SetEnd(t time.Time)

SetEnd sets the "end" field.

func (*TradeTimeRangeMutation) SetField

func (m *TradeTimeRangeMutation) 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 (*TradeTimeRangeMutation) SetIntervalID

func (m *TradeTimeRangeMutation) SetIntervalID(i int)

SetIntervalID sets the "interval_id" field.

func (*TradeTimeRangeMutation) SetOp

func (m *TradeTimeRangeMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*TradeTimeRangeMutation) SetStart

func (m *TradeTimeRangeMutation) SetStart(t time.Time)

SetStart sets the "start" field.

func (*TradeTimeRangeMutation) Start

func (m *TradeTimeRangeMutation) Start() (r time.Time, exists bool)

Start returns the value of the "start" field in the mutation.

func (TradeTimeRangeMutation) Tx

func (m TradeTimeRangeMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*TradeTimeRangeMutation) Type

func (m *TradeTimeRangeMutation) Type() string

Type returns the node type of this mutation (TradeTimeRange).

func (*TradeTimeRangeMutation) Where

Where appends a list predicates to the TradeTimeRangeMutation builder.

func (*TradeTimeRangeMutation) WhereP

func (m *TradeTimeRangeMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the TradeTimeRangeMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type TradeTimeRangeQuery

type TradeTimeRangeQuery struct {
	// contains filtered or unexported fields
}

TradeTimeRangeQuery is the builder for querying TradeTimeRange entities.

func (*TradeTimeRangeQuery) Aggregate

func (ttrq *TradeTimeRangeQuery) Aggregate(fns ...AggregateFunc) *TradeTimeRangeSelect

Aggregate returns a TradeTimeRangeSelect configured with the given aggregations.

func (*TradeTimeRangeQuery) All

All executes the query and returns a list of TradeTimeRanges.

func (*TradeTimeRangeQuery) AllX

AllX is like All, but panics if an error occurs.

func (*TradeTimeRangeQuery) Clone

Clone returns a duplicate of the TradeTimeRangeQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*TradeTimeRangeQuery) Count

func (ttrq *TradeTimeRangeQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TradeTimeRangeQuery) CountX

func (ttrq *TradeTimeRangeQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*TradeTimeRangeQuery) Exist

func (ttrq *TradeTimeRangeQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*TradeTimeRangeQuery) ExistX

func (ttrq *TradeTimeRangeQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*TradeTimeRangeQuery) First

First returns the first TradeTimeRange entity from the query. Returns a *NotFoundError when no TradeTimeRange was found.

func (*TradeTimeRangeQuery) FirstID

func (ttrq *TradeTimeRangeQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first TradeTimeRange ID from the query. Returns a *NotFoundError when no TradeTimeRange ID was found.

func (*TradeTimeRangeQuery) FirstIDX

func (ttrq *TradeTimeRangeQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*TradeTimeRangeQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*TradeTimeRangeQuery) GroupBy

func (ttrq *TradeTimeRangeQuery) GroupBy(field string, fields ...string) *TradeTimeRangeGroupBy

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 {
	Start time.Time `json:"start,omitempty"`
	Count int `json:"count,omitempty"`
}

client.TradeTimeRange.Query().
	GroupBy(tradetimerange.FieldStart).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TradeTimeRangeQuery) IDs

func (ttrq *TradeTimeRangeQuery) IDs(ctx context.Context) ([]int, error)

IDs executes the query and returns a list of TradeTimeRange IDs.

func (*TradeTimeRangeQuery) IDsX

func (ttrq *TradeTimeRangeQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*TradeTimeRangeQuery) Limit

func (ttrq *TradeTimeRangeQuery) Limit(limit int) *TradeTimeRangeQuery

Limit the number of records to be returned by this query.

func (*TradeTimeRangeQuery) Offset

func (ttrq *TradeTimeRangeQuery) Offset(offset int) *TradeTimeRangeQuery

Offset to start from.

func (*TradeTimeRangeQuery) Only

Only returns a single TradeTimeRange entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one TradeTimeRange entity is found. Returns a *NotFoundError when no TradeTimeRange entities are found.

func (*TradeTimeRangeQuery) OnlyID

func (ttrq *TradeTimeRangeQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only TradeTimeRange ID in the query. Returns a *NotSingularError when more than one TradeTimeRange ID is found. Returns a *NotFoundError when no entities are found.

func (*TradeTimeRangeQuery) OnlyIDX

func (ttrq *TradeTimeRangeQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*TradeTimeRangeQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*TradeTimeRangeQuery) Order

Order specifies how the records should be ordered.

func (*TradeTimeRangeQuery) QueryInterval

func (ttrq *TradeTimeRangeQuery) QueryInterval() *IntervalQuery

QueryInterval chains the current query on the "interval" edge.

func (*TradeTimeRangeQuery) QueryRecords

func (ttrq *TradeTimeRangeQuery) QueryRecords() *TradeRecordQuery

QueryRecords chains the current query on the "records" edge.

func (*TradeTimeRangeQuery) Select

func (ttrq *TradeTimeRangeQuery) Select(fields ...string) *TradeTimeRangeSelect

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 {
	Start time.Time `json:"start,omitempty"`
}

client.TradeTimeRange.Query().
	Select(tradetimerange.FieldStart).
	Scan(ctx, &v)

func (*TradeTimeRangeQuery) Unique

func (ttrq *TradeTimeRangeQuery) Unique(unique bool) *TradeTimeRangeQuery

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 (*TradeTimeRangeQuery) Where

Where adds a new predicate for the TradeTimeRangeQuery builder.

func (*TradeTimeRangeQuery) WithInterval

func (ttrq *TradeTimeRangeQuery) WithInterval(opts ...func(*IntervalQuery)) *TradeTimeRangeQuery

WithInterval tells the query-builder to eager-load the nodes that are connected to the "interval" edge. The optional arguments are used to configure the query builder of the edge.

func (*TradeTimeRangeQuery) WithRecords

func (ttrq *TradeTimeRangeQuery) WithRecords(opts ...func(*TradeRecordQuery)) *TradeTimeRangeQuery

WithRecords tells the query-builder to eager-load the nodes that are connected to the "records" edge. The optional arguments are used to configure the query builder of the edge.

type TradeTimeRangeSelect

type TradeTimeRangeSelect struct {
	*TradeTimeRangeQuery
	// contains filtered or unexported fields
}

TradeTimeRangeSelect is the builder for selecting fields of TradeTimeRange entities.

func (*TradeTimeRangeSelect) Aggregate

func (ttrs *TradeTimeRangeSelect) Aggregate(fns ...AggregateFunc) *TradeTimeRangeSelect

Aggregate adds the given aggregation functions to the selector query.

func (*TradeTimeRangeSelect) Bool

func (s *TradeTimeRangeSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TradeTimeRangeSelect) BoolX

func (s *TradeTimeRangeSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TradeTimeRangeSelect) Bools

func (s *TradeTimeRangeSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TradeTimeRangeSelect) BoolsX

func (s *TradeTimeRangeSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TradeTimeRangeSelect) Float64

func (s *TradeTimeRangeSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TradeTimeRangeSelect) Float64X

func (s *TradeTimeRangeSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TradeTimeRangeSelect) Float64s

func (s *TradeTimeRangeSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TradeTimeRangeSelect) Float64sX

func (s *TradeTimeRangeSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TradeTimeRangeSelect) Int

func (s *TradeTimeRangeSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TradeTimeRangeSelect) IntX

func (s *TradeTimeRangeSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TradeTimeRangeSelect) Ints

func (s *TradeTimeRangeSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TradeTimeRangeSelect) IntsX

func (s *TradeTimeRangeSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TradeTimeRangeSelect) Scan

func (ttrs *TradeTimeRangeSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*TradeTimeRangeSelect) ScanX

func (s *TradeTimeRangeSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*TradeTimeRangeSelect) String

func (s *TradeTimeRangeSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TradeTimeRangeSelect) StringX

func (s *TradeTimeRangeSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TradeTimeRangeSelect) Strings

func (s *TradeTimeRangeSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TradeTimeRangeSelect) StringsX

func (s *TradeTimeRangeSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TradeTimeRangeUpdate

type TradeTimeRangeUpdate struct {
	// contains filtered or unexported fields
}

TradeTimeRangeUpdate is the builder for updating TradeTimeRange entities.

func (*TradeTimeRangeUpdate) AddRecordIDs

func (ttru *TradeTimeRangeUpdate) AddRecordIDs(ids ...int) *TradeTimeRangeUpdate

AddRecordIDs adds the "records" edge to the TradeRecord entity by IDs.

func (*TradeTimeRangeUpdate) AddRecords

func (ttru *TradeTimeRangeUpdate) AddRecords(t ...*TradeRecord) *TradeTimeRangeUpdate

AddRecords adds the "records" edges to the TradeRecord entity.

func (*TradeTimeRangeUpdate) ClearInterval

func (ttru *TradeTimeRangeUpdate) ClearInterval() *TradeTimeRangeUpdate

ClearInterval clears the "interval" edge to the Interval entity.

func (*TradeTimeRangeUpdate) ClearRecords

func (ttru *TradeTimeRangeUpdate) ClearRecords() *TradeTimeRangeUpdate

ClearRecords clears all "records" edges to the TradeRecord entity.

func (*TradeTimeRangeUpdate) Exec

func (ttru *TradeTimeRangeUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TradeTimeRangeUpdate) ExecX

func (ttru *TradeTimeRangeUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TradeTimeRangeUpdate) Mutation

func (ttru *TradeTimeRangeUpdate) Mutation() *TradeTimeRangeMutation

Mutation returns the TradeTimeRangeMutation object of the builder.

func (*TradeTimeRangeUpdate) RemoveRecordIDs

func (ttru *TradeTimeRangeUpdate) RemoveRecordIDs(ids ...int) *TradeTimeRangeUpdate

RemoveRecordIDs removes the "records" edge to TradeRecord entities by IDs.

func (*TradeTimeRangeUpdate) RemoveRecords

func (ttru *TradeTimeRangeUpdate) RemoveRecords(t ...*TradeRecord) *TradeTimeRangeUpdate

RemoveRecords removes "records" edges to TradeRecord entities.

func (*TradeTimeRangeUpdate) Save

func (ttru *TradeTimeRangeUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*TradeTimeRangeUpdate) SaveX

func (ttru *TradeTimeRangeUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*TradeTimeRangeUpdate) SetEnd

SetEnd sets the "end" field.

func (*TradeTimeRangeUpdate) SetInterval

func (ttru *TradeTimeRangeUpdate) SetInterval(i *Interval) *TradeTimeRangeUpdate

SetInterval sets the "interval" edge to the Interval entity.

func (*TradeTimeRangeUpdate) SetIntervalID

func (ttru *TradeTimeRangeUpdate) SetIntervalID(i int) *TradeTimeRangeUpdate

SetIntervalID sets the "interval_id" field.

func (*TradeTimeRangeUpdate) SetStart

SetStart sets the "start" field.

func (*TradeTimeRangeUpdate) Where

Where appends a list predicates to the TradeTimeRangeUpdate builder.

type TradeTimeRangeUpdateOne

type TradeTimeRangeUpdateOne struct {
	// contains filtered or unexported fields
}

TradeTimeRangeUpdateOne is the builder for updating a single TradeTimeRange entity.

func (*TradeTimeRangeUpdateOne) AddRecordIDs

func (ttruo *TradeTimeRangeUpdateOne) AddRecordIDs(ids ...int) *TradeTimeRangeUpdateOne

AddRecordIDs adds the "records" edge to the TradeRecord entity by IDs.

func (*TradeTimeRangeUpdateOne) AddRecords

AddRecords adds the "records" edges to the TradeRecord entity.

func (*TradeTimeRangeUpdateOne) ClearInterval

func (ttruo *TradeTimeRangeUpdateOne) ClearInterval() *TradeTimeRangeUpdateOne

ClearInterval clears the "interval" edge to the Interval entity.

func (*TradeTimeRangeUpdateOne) ClearRecords

func (ttruo *TradeTimeRangeUpdateOne) ClearRecords() *TradeTimeRangeUpdateOne

ClearRecords clears all "records" edges to the TradeRecord entity.

func (*TradeTimeRangeUpdateOne) Exec

func (ttruo *TradeTimeRangeUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TradeTimeRangeUpdateOne) ExecX

func (ttruo *TradeTimeRangeUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TradeTimeRangeUpdateOne) Mutation

Mutation returns the TradeTimeRangeMutation object of the builder.

func (*TradeTimeRangeUpdateOne) RemoveRecordIDs

func (ttruo *TradeTimeRangeUpdateOne) RemoveRecordIDs(ids ...int) *TradeTimeRangeUpdateOne

RemoveRecordIDs removes the "records" edge to TradeRecord entities by IDs.

func (*TradeTimeRangeUpdateOne) RemoveRecords

func (ttruo *TradeTimeRangeUpdateOne) RemoveRecords(t ...*TradeRecord) *TradeTimeRangeUpdateOne

RemoveRecords removes "records" edges to TradeRecord entities.

func (*TradeTimeRangeUpdateOne) Save

Save executes the query and returns the updated TradeTimeRange entity.

func (*TradeTimeRangeUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*TradeTimeRangeUpdateOne) Select

func (ttruo *TradeTimeRangeUpdateOne) Select(field string, fields ...string) *TradeTimeRangeUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*TradeTimeRangeUpdateOne) SetEnd

SetEnd sets the "end" field.

func (*TradeTimeRangeUpdateOne) SetInterval

SetInterval sets the "interval" edge to the Interval entity.

func (*TradeTimeRangeUpdateOne) SetIntervalID

func (ttruo *TradeTimeRangeUpdateOne) SetIntervalID(i int) *TradeTimeRangeUpdateOne

SetIntervalID sets the "interval_id" field.

func (*TradeTimeRangeUpdateOne) SetStart

SetStart sets the "start" field.

type TradeTimeRanges

type TradeTimeRanges []*TradeTimeRange

TradeTimeRanges is a parsable slice of TradeTimeRange.

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 {

	// BarGroup is the client for interacting with the BarGroup builders.
	BarGroup *BarGroupClient
	// BarRecord is the client for interacting with the BarRecord builders.
	BarRecord *BarRecordClient
	// BarTimeRange is the client for interacting with the BarTimeRange builders.
	BarTimeRange *BarTimeRangeClient
	// DataSource is the client for interacting with the DataSource builders.
	DataSource *DataSourceClient
	// Dividend is the client for interacting with the Dividend builders.
	Dividend *DividendClient
	// Entity is the client for interacting with the Entity builders.
	Entity *EntityClient
	// Exchange is the client for interacting with the Exchange builders.
	Exchange *ExchangeClient
	// Financial is the client for interacting with the Financial builders.
	Financial *FinancialClient
	// Interval is the client for interacting with the Interval builders.
	Interval *IntervalClient
	// MarketHours is the client for interacting with the MarketHours builders.
	MarketHours *MarketHoursClient
	// MarketInfo is the client for interacting with the MarketInfo builders.
	MarketInfo *MarketInfoClient
	// Split is the client for interacting with the Split builders.
	Split *SplitClient
	// TradeCondition is the client for interacting with the TradeCondition builders.
	TradeCondition *TradeConditionClient
	// TradeCorrection is the client for interacting with the TradeCorrection builders.
	TradeCorrection *TradeCorrectionClient
	// TradeRecord is the client for interacting with the TradeRecord builders.
	TradeRecord *TradeRecordClient
	// TradeTimeRange is the client for interacting with the TradeTimeRange builders.
	TradeTimeRange *TradeTimeRangeClient
	// 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.

Source Files

Directories

Path Synopsis
Code generated by ogen, DO NOT EDIT.
Code generated by ogen, DO NOT EDIT.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL