Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder for indexes on vertex columns and edges in the graph.
func Edges ¶
Edges creates an index on the given vertex edge fields. Note that indexes are implemented only for SQL dialects, and does not support gremlin.
func (T) Indexes() []ent.Index {
// Unique index of field under 2 edges.
index.Field("name").
Edges("parent", "type").
Unique(),
}
func Fields ¶
Fields creates an index on the given vertex fields. Note that indexes are implemented only for SQL dialects, and does not support gremlin.
func (T) Indexes() []ent.Index {
// Unique index on 2 fields.
index.Fields("first", "last").
Unique(),
// Unique index of field under specific edge.
index.Fields("name").
FromEdges("parent").
Unique(),
}
func (*Builder) Descriptor ¶
func (b *Builder) Descriptor() *Descriptor
Descriptor implements the ent.Descriptor interface.
func (*Builder) Edges ¶
Edges sets the fields index to be unique under the set of edges (sub-graph). For example:
func (T) Indexes() []ent.Index {
// Unique "name" field under the "parent" edge.
index.Fields("name").
Edges("parent").
Unique(),
}
func (*Builder) Fields ¶
Fields sets the fields of the index.
func (T) Indexes() []ent.Index {
// Unique "name" and "age" fields under the "parent" edge.
index.Edges("parent").
Fields("name", "age").
Unique(),
}
func (*Builder) StorageKey ¶
StorageKey sets the storage key of the index. In SQL dialects, it's the index name.
Click to show internal directories.
Click to hide internal directories.