Documentation
¶
Index ¶
- Variables
- func CreateConstraint(database *gorm.DB, constraint *Constraint) error
- func CreateConstraints(database *gorm.DB, constraints []*Constraint) error
- func HasConstraint(database *gorm.DB, constraint *Constraint) bool
- func SetupJoinTable(database *gorm.DB, joinField *JoinField) error
- func SetupJoinTables(database *gorm.DB, joinFields []*JoinField) (err error)
- type Constraint
- type JoinField
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNilJoinField = errors.New("join field cannot be nil") ErrNilConstraint = errors.New("constraint cannot be nil") )
Functions ¶
func CreateConstraint ¶ added in v0.3.2
func CreateConstraint(database *gorm.DB, constraint *Constraint) error
CreateConstraint creates a new constraint
func CreateConstraints ¶ added in v0.3.2
func CreateConstraints(database *gorm.DB, constraints []*Constraint) error
CreateConstraints creates new constraints
func HasConstraint ¶ added in v0.3.3
func HasConstraint(database *gorm.DB, constraint *Constraint) bool
HasConstraint checks if a constraint exists
func SetupJoinTable ¶
SetupJoinTable setups the join table
Types ¶
type Constraint ¶ added in v0.3.2
type Constraint struct {
// contains filtered or unexported fields
}
Constraint struct
func NewConstraint ¶ added in v0.3.2
func NewConstraint(model interface{}, field string) *Constraint
NewConstraint creates a new constraint
Click to show internal directories.
Click to hide internal directories.