test

package
v0.18.2 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Run = runner.Run
View Source
var RunBenchmark = runner.RunBenchmark
View Source
var RunNoTx = runner.RunNoTx

Functions

func QueryTest

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

Types

type Bar

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

func (*Bar) Table

func (h *Bar) Table() string

type Case

type Case struct {
	Name             string
	Builder          helpers.SQLStringer
	ExpectedSQL      string
	ExpectedBindings []any
}

type Foo

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

func (*Foo) Table

func (h *Foo) Table() string

type FooSoftDelete added in v0.18.0

type FooSoftDelete struct {
	model.BaseModel
	mixins.SoftDelete
	ID   int    `json:"id"   db:"id,primary,autoincrement"`
	Name string `json:"name" db:"name"`
}

func (*FooSoftDelete) Table added in v0.18.0

func (h *FooSoftDelete) Table() string

Jump to

Keyboard shortcuts

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