Documentation
¶
Index ¶
- Constants
- func SkipHooks(ctx context.Context) context.Context
- type Columns
- func (c Columns) Except(cols ...string) Columns
- func (c Columns) Names() []string
- func (c Columns) Only(cols ...string) Columns
- func (c Columns) WithAggFunc(a, b string) Columns
- func (c Columns) WithParent(p ...string) Columns
- func (c Columns) WithPrefix(prefix string) Columns
- func (c Columns) WriteSQL(w io.Writer, d bob.Dialect, start int) ([]any, error)
- type Hook
- type Hooks
- type RelSetDetails
- type RelSetMapping
- type RelSide
- type RelWhere
- type Relationship
- func (r Relationship) Foreign() string
- func (r Relationship) InsertEarly() bool
- func (r Relationship) IsRemovable() bool
- func (r Relationship) IsToMany() bool
- func (r Relationship) Local() string
- func (r Relationship) NeededColumns() []string
- func (r Relationship) StaticSides() []struct{ ... }
- func (r Relationship) ValuedSides() []RelSetDetails
- type RelationshipChainError
Constants ¶
View Source
const ( // The prefix of an eager loaded relationship CtxLoadPrefix ctxKey = iota // The alias of an eager loader's parent CtxLoadParentAlias )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Columns ¶
type Columns struct {
// contains filtered or unexported fields
}
func NewColumns ¶
NewColumns returns a Columns object with the given column names
func (Columns) WithAggFunc ¶
func (Columns) WithParent ¶
WithPrefix sets the parent of the columns
func (Columns) WithPrefix ¶
WithPrefix sets the prefix of the aliases of the column set
type Hook ¶ added in v0.2.3
Hook is a function that can be called during lifecycle of an object the context can be modified and returned The caller is expected to use the returned context for subsequent processing
type Hooks ¶ added in v0.2.3
type Hooks[T any] struct { // contains filtered or unexported fields }
Hooks is a set of hooks that can be called all at once
type RelSetDetails ¶ added in v0.6.1
type RelSetDetails struct {
TableName string
Mapped []RelSetMapping
}
type RelSetMapping ¶ added in v0.6.1
type RelSide ¶ added in v0.2.1
type RelSide struct {
From string
FromColumns []string
To string
ToColumns []string
FromWhere, ToWhere []RelWhere
// If the destination columns contain the key
// if false, it means the source columns are the foreign key
ToKey bool
// if the destination is unique
ToUnique bool
// If the key is nullable. We need this to know if we can remove the
// relationship without deleting it
KeyNullable bool
}
type Relationship ¶
type Relationship struct {
Name string
ByJoinTable bool
Sides []RelSide
Ignored bool // Can be set through user configuration
}
func (Relationship) Foreign ¶ added in v0.6.1
func (r Relationship) Foreign() string
func (Relationship) InsertEarly ¶ added in v0.6.1
func (r Relationship) InsertEarly() bool
func (Relationship) IsRemovable ¶ added in v0.6.1
func (r Relationship) IsRemovable() bool
func (Relationship) IsToMany ¶ added in v0.6.1
func (r Relationship) IsToMany() bool
func (Relationship) Local ¶ added in v0.6.1
func (r Relationship) Local() string
func (Relationship) NeededColumns ¶ added in v0.6.1
func (r Relationship) NeededColumns() []string
func (Relationship) StaticSides ¶ added in v0.6.1
func (r Relationship) StaticSides() []struct { Table string Columns [][2]string }
func (Relationship) ValuedSides ¶ added in v0.6.1
func (r Relationship) ValuedSides() []RelSetDetails
type RelationshipChainError ¶ added in v0.6.1
type RelationshipChainError struct {
Table1 string
Column1 string
Value string
Table2 string
Column2 string
}
RelationshipChainError is the error returned when a wrong value is encountered in a relationship chain
func (*RelationshipChainError) Error ¶ added in v0.6.1
func (e *RelationshipChainError) Error() string
Click to show internal directories.
Click to hide internal directories.