testutils

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupTestDB

func SetupTestDB() *gorm.DB

Types

type Person

type Person struct {
	ID    uint
	Name  string
	Email string
}

type PersonDB

type PersonDB struct {
	ID    uint   `gorm:"primaryKey;autoIncrement"`
	Name  string `gorm:"not null"`
	Email string `gorm:"not null"`
}

func (*PersonDB) From

func (pdb *PersonDB) From(p Person)

func (PersonDB) Into

func (pdb PersonDB) Into() Person

func (PersonDB) TableName

func (pdb PersonDB) TableName() string

type User

type User struct {
	ID       uint
	Username string
	Password string
	Person   Person
}

type UserDB

type UserDB struct {
	ID       uint     `gorm:"primaryKey;autoIncrement"`
	Username string   `gorm:"not null"`
	Password string   `gorm:"not null"`
	PersonID uint     `gorm:"not null"`
	Person   PersonDB `gorm:"column:person_id;not null"`
}

func (*UserDB) From

func (udb *UserDB) From(u User)

func (UserDB) Into

func (udb UserDB) Into() User

func (UserDB) TableName

func (udb UserDB) TableName() string

Jump to

Keyboard shortcuts

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