tests

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BadAutoInc added in v0.1.0

type BadAutoInc struct {
	ID string `db:"autoincrement"`
}

type BadTimeNoTag added in v0.1.3

type BadTimeNoTag struct {
	ID        string `db:"pk"`
	Name      string
	CreatedAt time.Time
}

type MockChild added in v0.1.4

type MockChild struct {
	ID           string `db:"pk"`
	MockParentID string `db:"ref=mock_parents"`
	Value        string
}

type MockParent added in v0.1.4

type MockParent struct {
	ID   string
	Name string
	Kids []MockChild // no tag — relation auto-detected via MockChild.MockParentID
}

MockParent / MockChild: relation auto-detection fixture.

type ModelWithIgnored added in v0.1.3

type ModelWithIgnored struct {
	ID      string `db:"pk"`
	Name    string
	Tags    []string `db:"-"` // slice: silently ignored
	Friends []User   `db:"-"` // struct slice: silently ignored
	Score   float64
}

type MultiA added in v0.1.3

type MultiA struct {
	ID   string `db:"pk"`
	Name string
}

func (MultiA) TableName added in v0.1.3

func (MultiA) TableName() string

type MultiB added in v0.1.3

type MultiB struct {
	ID    string `db:"pk"`
	Value int64
}

type NumericTypes added in v0.1.1

type NumericTypes struct {
	IDNumeric int32 `db:"pk,not_null"` // PK + NotNull → bitmask 5
	CountUint uint64
	RatioF32  float32
}

NumericTypes covers int32, uint64, float32 mapping and bitmask constraints.

type Order added in v0.1.0

type Order struct {
	ID     string `db:"pk"`
	UserID int    `db:"ref=users:id"`
	Total  float64
}

type PointerReceiver added in v0.1.4

type PointerReceiver struct {
	ID   string `db:"pk"`
	Name string
}

PointerReceiver tests that detectTableName handles pointer receivers (*T).

func (*PointerReceiver) TableName added in v0.1.4

func (*PointerReceiver) TableName() string

type RefNoColumn added in v0.1.1

type RefNoColumn struct {
	IDRef    string `db:"pk"`
	ParentID int64  `db:"ref=parents"`
}

RefNoColumn covers db:"ref=table" without a specific column (RefColumn must be "").

type Unsupp added in v0.1.0

type Unsupp struct {
	Ch chan int
}

type User

type User struct {
	ID        int    `db:"pk"`
	FirstName string `db:"not_null"`
	LastName  string
	Email     string `db:"unique"`
	Score     float64
	IsActive  bool
	Avatar    []byte
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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