specs

package
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package specs defines test specifications for grimoire's adapter.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Aggregate

func Aggregate(t *testing.T, repo grimoire.Repo)

Aggregate tests count specifications.

func CheckConstraint

func CheckConstraint(t *testing.T, repo grimoire.Repo)

CheckConstraint tests foreign key constraint specifications.

func Delete

func Delete(t *testing.T, repo grimoire.Repo)

Delete tests delete specifications.

func ForeignKeyConstraint

func ForeignKeyConstraint(t *testing.T, repo grimoire.Repo)

ForeignKeyConstraint tests foreign key constraint specifications.

func Insert

func Insert(t *testing.T, repo grimoire.Repo)

Insert tests insert specifications.

func InsertAll

func InsertAll(t *testing.T, repo grimoire.Repo)

InsertAll tests insert multiple specifications.

func InsertSet

func InsertSet(t *testing.T, repo grimoire.Repo)

InsertSet tests insert specifications only using Set query.

func Preload

func Preload(t *testing.T, repo grimoire.Repo)

Preload tests query specifications for preloading.

func Query

func Query(t *testing.T, repo grimoire.Repo)

Query tests query specifications without join.

func QueryJoin

func QueryJoin(t *testing.T, repo grimoire.Repo)

QueryJoin tests query specifications with join.

func QueryNotFound

func QueryNotFound(t *testing.T, repo grimoire.Repo)

QueryNotFound tests query specifications when no result found.

func SaveInsert

func SaveInsert(t *testing.T, repo grimoire.Repo)

SaveInsert tests insert specifications.

func SaveInsertAll

func SaveInsertAll(t *testing.T, repo grimoire.Repo)

SaveInsertAll tests insert multiple recors specifications.

func SaveUpdate

func SaveUpdate(t *testing.T, repo grimoire.Repo)

SaveUpdate tests update specifications.

func Transaction

func Transaction(t *testing.T, repo grimoire.Repo)

Transaction tests insert specifications.

func UniqueConstraint

func UniqueConstraint(t *testing.T, repo grimoire.Repo)

UniqueConstraint tests unique constraint specifications.

func Update

func Update(t *testing.T, repo grimoire.Repo)

Update tests update specifications.

func UpdateSet

func UpdateSet(t *testing.T, repo grimoire.Repo)

UpdateSet tests update specifications using Set query.

func UpdateWhere

func UpdateWhere(t *testing.T, repo grimoire.Repo)

UpdateWhere tests update specifications.

Types

type Address

type Address struct {
	ID        int64
	User      User
	UserID    *int64
	Address   string
	CreatedAt time.Time
	UpdatedAt time.Time
}

Address defines addresses schema.

type Extra

type Extra struct {
	ID    uint
	Slug  *string
	Score int
}

Extra defines baz schema.

type User

type User struct {
	ID        int64
	Name      string
	Gender    string
	Age       int
	Note      *string
	Addresses []Address
	CreatedAt time.Time
	UpdatedAt time.Time
}

User defines users schema.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL