test

package
v0.11.4 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func QueryTest

func QueryTest(t *testing.T, testCases []Case)

func WithDatabase

func WithDatabase(cb func(tx *sqlx.Tx))

Types

type Bar

type Bar struct {
	models.BaseModel
	ID    int                      `db:"id,primary" json:"id"`
	FooID int                      `db:"foo_id"     json:"foo_id"`
	Foo   *selects.BelongsTo[*Foo] `db:"-"          json:"foo"`
}

type Case

type Case struct {
	Name             string
	Builder          builder.ToSQLer
	ExpectedSQL      string
	ExpectedBindings []any
}

type Foo

type Foo struct {
	models.BaseModel
	ID   int                    `db:"id,primary" json:"id"`
	Name string                 `db:"name"       json:"name"`
	Bar  *selects.HasOne[*Bar]  `db:"-"          json:"bar"`
	Bars *selects.HasMany[*Bar] `db:"-"          json:"bars"`
}

Jump to

Keyboard shortcuts

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