test

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 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

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.ToSQLer
	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

Jump to

Keyboard shortcuts

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