mysql_test

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMySQLConfig

func GetMySQLConfig() neat.DBConfig

GetMySQLConfig returns a MySQL connection config from environment variables

func SetupMySQLConnection

func SetupMySQLConnection(t *testing.T) *database.Database

SetupMySQLConnection creates a database connection without setting up tables

func SetupMySQLTest

func SetupMySQLTest(t *testing.T) *database.Database

SetupMySQLTest creates a database connection and sets up test tables for MySQL

func SetupTestDB

func SetupTestDB(config neat.DBConfig) (*database.Database, error)

SetupTestDB creates a database connection and sets up test tables

func TeardownTestDB

func TeardownTestDB(db *database.Database) error

TeardownTestDB drops test tables and closes the connection

Types

type TestModel

type TestModel struct {
	ID        uint      `db:"id"`
	Name      string    `db:"name"`
	Email     string    `db:"email"`
	Age       int       `db:"age"`
	Active    bool      `db:"active"`
	CreatedAt time.Time `db:"created_at"`
	UpdatedAt time.Time `db:"updated_at"`
}

TestModel is a simple model for integration testing

func (TestModel) TableName

func (TestModel) TableName() string

Jump to

Keyboard shortcuts

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