golibdataTestUtil

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertDatabaseCount

func AssertDatabaseCount(t *testing.T, table string, expected int64)

AssertDatabaseCount assert database has number of row without query

func AssertDatabaseHas

func AssertDatabaseHas(t *testing.T, table string, conditions map[string]interface{})

AssertDatabaseHas assert database has more than a row with query params

func CountWithQuery

func CountWithQuery(table string, conditions map[string]interface{}) int64

func CountWithoutQuery

func CountWithoutQuery(table string) int64

func DB

func DB() *gorm.DB

DB return gorm instance

func DatabaseTestUtilOpt

func DatabaseTestUtilOpt() fx.Option

DatabaseTestUtilOpt Deprecated: use EnableDatabaseTestUtilOpt instead

func EnableDatabaseTestUtilOpt

func EnableDatabaseTestUtilOpt() fx.Option

func EnableRedisTestUtilOpt

func EnableRedisTestUtilOpt() fx.Option

func Insert

func Insert(model interface{})

func RedisClient

func RedisClient() *redis.Client

func RedisTestUtilOpt

func RedisTestUtilOpt() fx.Option

RedisTestUtilOpt Deprecated: use EnableRedisTestUtilOpt instead

func TruncateTables

func TruncateTables(tables ...string)

func TruncateTablesHasForeignKey

func TruncateTablesHasForeignKey(tables ...string)

func TruncateTablesHasForeignKeyOpt

func TruncateTablesHasForeignKeyOpt(tables ...string) fx.Option

func TruncateTablesOpt

func TruncateTablesOpt(tables ...string) fx.Option

Types

This section is empty.

Jump to

Keyboard shortcuts

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