Versions in this module Expand all Collapse all v0 v0.0.1 Oct 24, 2024 Changes in this version + const FuncSelector + func BatchCreate(ctx context.Context, drv dialect.Driver, spec *BatchCreateSpec) error + func CountNodes(ctx context.Context, drv dialect.Driver, spec *QuerySpec) (int, error) + func CreateNode(ctx context.Context, drv dialect.Driver, spec *CreateSpec) error + func DeleteNodes(ctx context.Context, drv dialect.Driver, spec *DeleteSpec) (int, error) + func HasNeighbors(q *sql.Selector, s *Step) + func HasNeighborsWith(q *sql.Selector, s *Step, pred func(*sql.Selector)) + func IsConstraintError(err error) bool + func IsForeignKeyConstraintError(err error) bool + func IsUniqueConstraintError(err error) bool + func LimitNeighbors(partitionBy string, limit int, orderBy ...sql.Querier) func(*sql.Selector) + func Neighbors(dialect string, s *Step) (q *sql.Selector) + func OrderByNeighborTerms(q *sql.Selector, s *Step, opts ...sql.OrderTerm) + func OrderByNeighborsCount(q *sql.Selector, s *Step, opts ...sql.OrderTermOption) + func QueryEdges(ctx context.Context, drv dialect.Driver, spec *EdgeQuerySpec) error + func QueryNodes(ctx context.Context, drv dialect.Driver, spec *QuerySpec) error + func SetNeighbors(dialect string, s *Step) (q *sql.Selector) + func UpdateNode(ctx context.Context, drv dialect.Driver, spec *UpdateSpec) error + func UpdateNodes(ctx context.Context, drv dialect.Driver, spec *UpdateSpec) (int, error) + func WrapFunc(s func(*sql.Selector)) *entql.CallExpr + type BatchCreateSpec struct + Nodes []*CreateSpec + OnConflict []sql.ConflictOption + type ConstraintError struct + func (e ConstraintError) Error() string + type CreateSpec struct + Edges []*EdgeSpec + Fields []*FieldSpec + ID *FieldSpec + OnConflict []sql.ConflictOption + Schema string + Table string + func NewCreateSpec(table string, id *FieldSpec) *CreateSpec + func (u *CreateSpec) SetField(column string, t field.Type, value driver.Value) + type DeleteSpec struct + Node *NodeSpec + Predicate func(*sql.Selector) + func NewDeleteSpec(table string, id *FieldSpec) *DeleteSpec + type EdgeMut struct + Add []*EdgeSpec + Clear []*EdgeSpec + type EdgeQuerySpec struct + Assign func(out, in any) error + Edge *EdgeSpec + Predicate func(*sql.Selector) + ScanValues func() [2]any + type EdgeSpec struct + Bidi bool + Columns []string + Inverse bool + Rel Rel + Schema string + Table string + Target *EdgeTarget + type EdgeSpecs []*EdgeSpec + func (es EdgeSpecs) FilterRel(r Rel) EdgeSpecs + func (es EdgeSpecs) GroupRel() map[Rel][]*EdgeSpec + func (es EdgeSpecs) GroupTable() map[string][]*EdgeSpec + type EdgeTarget struct + Fields []*FieldSpec + IDSpec *FieldSpec + Nodes []driver.Value + func (e *EdgeTarget) FieldValues() []any + type FieldMut struct + Add []*FieldSpec + Clear []*FieldSpec + Set []*FieldSpec + type FieldSpec struct + Column string + Type field.Type + Value driver.Value + func NewFieldSpec(column string, typ field.Type) *FieldSpec + type NeighborsLimit struct + DefaultOrderField string + LimitCTE string + RowNumber string + SrcCTE string + func (l *NeighborsLimit) Modifier(partitionBy string, limit int, orderBy ...sql.Querier) func(s *sql.Selector) + type Node struct + Edges map[string]struct{ ... } + Fields map[string]*FieldSpec + Type string + type NodeSpec struct + Columns []string + CompositeID []*FieldSpec + ID *FieldSpec + Schema string + Table string + func (n *NodeSpec) AddColumnOnce(column string) *NodeSpec + type NotFoundError struct + func (e *NotFoundError) Error() string + type QuerySpec struct + Assign func(columns []string, values []any) error + From *sql.Selector + Limit int + Modifiers []func(*sql.Selector) + Node *NodeSpec + Offset int + Order func(*sql.Selector) + Predicate func(*sql.Selector) + ScanValues func(columns []string) ([]any, error) + Unique bool + func NewQuerySpec(table string, columns []string, id *FieldSpec) *QuerySpec + type Rel int + const M2M + const M2O + const O2M + const O2O + func (r Rel) String() (s string) + type Schema struct + Nodes []*Node + func (g *Schema) AddE(name string, spec *EdgeSpec, from, to string) error + func (g *Schema) EvalP(nodeType string, p entql.P, selector *sql.Selector) error + func (g *Schema) MustAddE(name string, spec *EdgeSpec, from, to string) + type Step struct + Edge struct{ ... } + From struct{ ... } + To struct{ ... } + func NewStep(opts ...StepOption) *Step + func (s *Step) FromEdgeOwner() bool + func (s *Step) ThroughEdgeTable() bool + func (s *Step) ToEdgeOwner() bool + type StepOption func(*Step) + func Edge(rel Rel, inverse bool, table string, columns ...string) StepOption + func From(table, column string, v ...any) StepOption + func To(table, column string) StepOption + type UpdateSpec struct + Assign func(columns []string, values []any) error + Edges EdgeMut + Fields FieldMut + Modifiers []func(*sql.UpdateBuilder) + Node *NodeSpec + Predicate func(*sql.Selector) + ScanValues func(columns []string) ([]any, error) + func NewUpdateSpec(table string, columns []string, id ...*FieldSpec) *UpdateSpec + func (u *UpdateSpec) AddField(column string, t field.Type, value driver.Value) + func (u *UpdateSpec) AddModifier(m func(*sql.UpdateBuilder)) + func (u *UpdateSpec) AddModifiers(m ...func(*sql.UpdateBuilder)) + func (u *UpdateSpec) ClearField(column string, t field.Type) + func (u *UpdateSpec) SetField(column string, t field.Type, value driver.Value)