Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Descriptor ¶
type Descriptor struct { Tag string // struct tag. Type string // edge type. Name string // edge name. RefName string // ref name; inverse only. Ref *Descriptor // edge reference; to/from of the same type. Unique bool // unique edge. Inverse bool // inverse edge. Required bool // required on creation. StorageKey *StorageKey // optional storage-key configuration. }
A Descriptor for edge configuration.
type StorageKey ¶ added in v0.2.4
StorageKey holds the configuration for edge storage-key.
type StorageOption ¶ added in v0.2.4
type StorageOption func(*StorageKey)
StorageOption allows for setting the storage configuration using functional options.
func Column ¶ added in v0.2.4
func Column(name string) StorageOption
The Column option sets the foreign-key column name for O2O, O2M and M2O edges. Note that, for M2M edges (2 columns), use the edge.Columns option.
func Columns ¶ added in v0.2.4
func Columns(to, from string) StorageOption
The Columns option sets the foreign-key column names for M2M edges. The 1st column defines the name of the "To" edge, and the 2nd defines the name of the "From" edge (inverse edge). Note that, for O2O, O2M and M2O edges, use the edge.Column option.
func Table ¶ added in v0.2.4
func Table(name string) StorageOption
The Table option sets the table name of M2M edges.
Click to show internal directories.
Click to hide internal directories.