Documentation ¶
Overview ¶
Package specs defines test specifications for rel's adapter.
Index ¶
- func Aggregate(t *testing.T, repo rel.Repository)
- func CheckConstraintOnInsert(t *testing.T, repo rel.Repository)
- func CheckConstraintOnUpdate(t *testing.T, repo rel.Repository)
- func Delete(t *testing.T, repo rel.Repository)
- func DeleteAll(t *testing.T, repo rel.Repository)
- func DeleteBelongsTo(t *testing.T, repo rel.Repository)
- func DeleteHasMany(t *testing.T, repo rel.Repository)
- func DeleteHasOne(t *testing.T, repo rel.Repository)
- func ForeignKeyConstraintOnInsert(t *testing.T, repo rel.Repository)
- func ForeignKeyConstraintOnUpdate(t *testing.T, repo rel.Repository)
- func Insert(t *testing.T, repo rel.Repository)
- func InsertAll(t *testing.T, repo rel.Repository)
- func InsertAllPartialCustomPrimary(t *testing.T, repo rel.Repository)
- func InsertBelongsTo(t *testing.T, repo rel.Repository)
- func InsertHasMany(t *testing.T, repo rel.Repository)
- func InsertHasOne(t *testing.T, repo rel.Repository)
- func Inserts(t *testing.T, repo rel.Repository)
- func Migrate(t *testing.T, repo rel.Repository, flags ...Flag)
- func PreloadBelongsTo(t *testing.T, repo rel.Repository)
- func PreloadBelongsToSlice(t *testing.T, repo rel.Repository)
- func PreloadBelongsToWithQuery(t *testing.T, repo rel.Repository)
- func PreloadHasMany(t *testing.T, repo rel.Repository)
- func PreloadHasManySlice(t *testing.T, repo rel.Repository)
- func PreloadHasManyWithQuery(t *testing.T, repo rel.Repository)
- func PreloadHasOne(t *testing.T, repo rel.Repository)
- func PreloadHasOneSlice(t *testing.T, repo rel.Repository)
- func PreloadHasOneWithQuery(t *testing.T, repo rel.Repository)
- func Query(t *testing.T, repo rel.Repository)
- func QueryJoin(t *testing.T, repo rel.Repository)
- func QueryNotFound(t *testing.T, repo rel.Repository)
- func QueryWhereSubQuery(t *testing.T, repo rel.Repository, flags ...Flag)
- func Setup(t *testing.T, repo rel.Repository) func()
- func UniqueConstraintOnInsert(t *testing.T, repo rel.Repository)
- func UniqueConstraintOnUpdate(t *testing.T, repo rel.Repository)
- func Update(t *testing.T, repo rel.Repository)
- func UpdateAll(t *testing.T, repo rel.Repository)
- func UpdateAtomic(t *testing.T, repo rel.Repository)
- func UpdateBelongsToInsert(t *testing.T, repo rel.Repository)
- func UpdateBelongsToUpdate(t *testing.T, repo rel.Repository)
- func UpdateHasManyInsert(t *testing.T, repo rel.Repository)
- func UpdateHasManyReplace(t *testing.T, repo rel.Repository)
- func UpdateHasManyUpdate(t *testing.T, repo rel.Repository)
- func UpdateHasOneInsert(t *testing.T, repo rel.Repository)
- func UpdateHasOneReplace(t *testing.T, repo rel.Repository)
- func UpdateHasOneUpdate(t *testing.T, repo rel.Repository)
- func UpdateNotFound(t *testing.T, repo rel.Repository)
- func Updates(t *testing.T, repo rel.Repository)
- type Address
- type Composite
- type Extra
- type Flag
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Aggregate ¶
func Aggregate(t *testing.T, repo rel.Repository)
Aggregate tests count specifications.
func CheckConstraintOnInsert ¶ added in v0.11.0
func CheckConstraintOnInsert(t *testing.T, repo rel.Repository)
CheckConstraintOnInsert tests foreign key constraint specifications on insert.
func CheckConstraintOnUpdate ¶ added in v0.11.0
func CheckConstraintOnUpdate(t *testing.T, repo rel.Repository)
CheckConstraintOnUpdate tests foreign key constraint specifications.
func DeleteAll ¶
func DeleteAll(t *testing.T, repo rel.Repository)
DeleteAll tests delete all specifications.
func DeleteBelongsTo ¶
func DeleteBelongsTo(t *testing.T, repo rel.Repository)
DeleteBelongsTo tests delete specifications.
func DeleteHasMany ¶
func DeleteHasMany(t *testing.T, repo rel.Repository)
DeleteHasMany tests delete specifications.
func DeleteHasOne ¶
func DeleteHasOne(t *testing.T, repo rel.Repository)
DeleteHasOne tests delete specifications.
func ForeignKeyConstraintOnInsert ¶ added in v0.11.0
func ForeignKeyConstraintOnInsert(t *testing.T, repo rel.Repository)
ForeignKeyConstraintOnInsert tests foreign key constraint specifications on insert.
func ForeignKeyConstraintOnUpdate ¶ added in v0.11.0
func ForeignKeyConstraintOnUpdate(t *testing.T, repo rel.Repository)
ForeignKeyConstraintOnUpdate tests foreign key constraint specifications on update.
func Insert ¶
func Insert(t *testing.T, repo rel.Repository)
Insert tests specification for database insertion.
func InsertAll ¶
func InsertAll(t *testing.T, repo rel.Repository)
InsertAll tests insert multiple specifications.
func InsertAllPartialCustomPrimary ¶
func InsertAllPartialCustomPrimary(t *testing.T, repo rel.Repository)
InsertAllPartialCustomPrimary tests insert multiple specifications.
func InsertBelongsTo ¶
func InsertBelongsTo(t *testing.T, repo rel.Repository)
InsertBelongsTo tests specification for insertion with belongs to association.
func InsertHasMany ¶
func InsertHasMany(t *testing.T, repo rel.Repository)
InsertHasMany tests specification insertion with has many association.
func InsertHasOne ¶
func InsertHasOne(t *testing.T, repo rel.Repository)
InsertHasOne tests specification for insertion with has one association.
func PreloadBelongsTo ¶
func PreloadBelongsTo(t *testing.T, repo rel.Repository)
PreloadBelongsTo tests specification for preloading belongs to association.
func PreloadBelongsToSlice ¶
func PreloadBelongsToSlice(t *testing.T, repo rel.Repository)
PreloadBelongsToSlice tests specification for preloading belongs to association from multiple records.
func PreloadBelongsToWithQuery ¶
func PreloadBelongsToWithQuery(t *testing.T, repo rel.Repository)
PreloadBelongsToWithQuery tests specification for preloading belongs to association.
func PreloadHasMany ¶
func PreloadHasMany(t *testing.T, repo rel.Repository)
PreloadHasMany tests specification for preloading has many association.
func PreloadHasManySlice ¶
func PreloadHasManySlice(t *testing.T, repo rel.Repository)
PreloadHasManySlice tests specification for preloading has many association from multiple records.
func PreloadHasManyWithQuery ¶
func PreloadHasManyWithQuery(t *testing.T, repo rel.Repository)
PreloadHasManyWithQuery tests specification for preloading has many association.
func PreloadHasOne ¶
func PreloadHasOne(t *testing.T, repo rel.Repository)
PreloadHasOne tests specification for preloading has one association.
func PreloadHasOneSlice ¶
func PreloadHasOneSlice(t *testing.T, repo rel.Repository)
PreloadHasOneSlice tests specification for preloading has one association from multiple records.
func PreloadHasOneWithQuery ¶
func PreloadHasOneWithQuery(t *testing.T, repo rel.Repository)
PreloadHasOneWithQuery tests specification for preloading has one association.
func Query ¶
func Query(t *testing.T, repo rel.Repository)
Query tests query specifications without join.
func QueryJoin ¶
func QueryJoin(t *testing.T, repo rel.Repository)
QueryJoin tests query specifications with join.
func QueryNotFound ¶
func QueryNotFound(t *testing.T, repo rel.Repository)
QueryNotFound tests query specifications when no result found.
func QueryWhereSubQuery ¶ added in v0.13.0
func QueryWhereSubQuery(t *testing.T, repo rel.Repository, flags ...Flag)
Query tests query specifications without join.
func Setup ¶
func Setup(t *testing.T, repo rel.Repository) func()
Setup database for specs execution.
func UniqueConstraintOnInsert ¶ added in v0.11.0
func UniqueConstraintOnInsert(t *testing.T, repo rel.Repository)
UniqueConstraintOnInsert tests unique constraint specifications on insert.
func UniqueConstraintOnUpdate ¶ added in v0.11.0
func UniqueConstraintOnUpdate(t *testing.T, repo rel.Repository)
UniqueConstraintOnUpdate tests unique constraint specifications on insert.
func Update ¶
func Update(t *testing.T, repo rel.Repository)
Update tests specification for updating a record.
func UpdateAll ¶
func UpdateAll(t *testing.T, repo rel.Repository)
UpdateAll tests update all specifications.
func UpdateAtomic ¶
func UpdateAtomic(t *testing.T, repo rel.Repository)
UpdateAtomic tests increment and decerement operation when updating a record.
func UpdateBelongsToInsert ¶
func UpdateBelongsToInsert(t *testing.T, repo rel.Repository)
UpdateBelongsToInsert tests specification for updating a record and inserting belongs to association.
func UpdateBelongsToUpdate ¶
func UpdateBelongsToUpdate(t *testing.T, repo rel.Repository)
UpdateBelongsToUpdate tests specification for updating a record and updating belongs to association.
func UpdateHasManyInsert ¶
func UpdateHasManyInsert(t *testing.T, repo rel.Repository)
UpdateHasManyInsert tests specification for updating a record and inserting has many association.
func UpdateHasManyReplace ¶
func UpdateHasManyReplace(t *testing.T, repo rel.Repository)
UpdateHasManyReplace tests specification for updating a record and replacing has many association.
func UpdateHasManyUpdate ¶
func UpdateHasManyUpdate(t *testing.T, repo rel.Repository)
UpdateHasManyUpdate tests specification for updating a record and updating has many association.
func UpdateHasOneInsert ¶
func UpdateHasOneInsert(t *testing.T, repo rel.Repository)
UpdateHasOneInsert tests specification for updating a record and inserting has many association.
func UpdateHasOneReplace ¶
func UpdateHasOneReplace(t *testing.T, repo rel.Repository)
UpdateHasOneReplace tests specification for updating a record and replacing has one association.
func UpdateHasOneUpdate ¶
func UpdateHasOneUpdate(t *testing.T, repo rel.Repository)
UpdateHasOneUpdate tests specification for updating a record and updating has one association.
func UpdateNotFound ¶
func UpdateNotFound(t *testing.T, repo rel.Repository)
UpdateNotFound tests specification for updating a not found record.
Types ¶
type Address ¶
type Address struct { ID int64 User User `autosave:"true"` UserID *int64 Name string CreatedAt time.Time UpdatedAt time.Time }
Address defines addresses schema.