Documentation ¶
Overview ¶
Package dbtest has utilities to help with writing DB related tests in conjunction with sqlize.
Index ¶
- Constants
- Variables
- func ColNoConst(t testing.TB, td bsq.TableDef, colNo int)
- func DriverName(t TB, fallback string) string
- func NewLogger(t interface{ ... }) sqlize.Logger
- func Open(t *testing.T, drv driver.Driver, source string, log sqlize.LogFlag) (*sql.DB, error)
- func OpenArgs(t TB, drvFallback, srcFallback string) (driver, source string)
- func ShallOpen(t *testing.T, drv driver.Driver, source string, log sqlize.LogFlag) *sql.DB
- func SourceName(t TB, fallback string) string
- func VerifyTable(t testing.TB, q sqlize.Querier, def bsq.TableDef, d Dialect) (ok bool)
- func VerifyTables(t testing.TB, q sqlize.Querier, d Dialect) (ok bool)
- type CRUDTest
- type Dialect
- type FieldDiff
- type TB
Constants ¶
View Source
const ( ENV_DBDRIVER = "SQLIZE_TESTDB_DRIVER" ENV_DBSOURCE = "SQLIZE_TESTDB_SOURCE" )
Variables ¶
View Source
var ExampleTB exampleTB
Functions ¶
func DriverName ¶
func NewLogger ¶
NewLogger creates a new logger to be used with sqlize.LogDriver. For an example read the test TestNewLogger.
func SourceName ¶
func VerifyTable ¶
Types ¶
type CRUDTest ¶
type FieldDiff ¶ added in v0.9.0
type FieldDiff []error
func FieldEq ¶ added in v0.9.0
func FieldEq[F comparable](e FieldDiff, hint string, l, r F) FieldDiff
func FieldEqual ¶ added in v0.9.0
type TB ¶ added in v0.8.8
TB has a subset of methods from testing.TB. It is implemented by [Errorer].
Click to show internal directories.
Click to hide internal directories.