db

package
v0.6.8 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitDB

func InitDB(db *gorm.DB)

func OpenDB

func OpenDB() *gorm.DB

OpenDB return the Database connection

Types

type Pet

type Pet struct {
	gorm.Model

	MasterID uuid.UUID
	Name     string
}

Pet is the model for test

func GetDefaultPet

func GetDefaultPet() []Pet

GetDefaultPet returns data to populate table

type User

type User struct {
	gorm.Model

	UUID         uuid.UUID
	Name         string
	Instrument   string `gorm:"type:varchar(16)"`
	Age          uint
	Candies      int
	BirthDate    time.Time
	Fun          bool
	Money        float32
	Bitcoins     float64
	Toys         int64
	End          int
	FavoriteSong string `gorm:"column:Favorite song"`
}

User is the model for test

func GetDefaultUser

func GetDefaultUser() []User

GetDefaultUser returns data to populate table

Jump to

Keyboard shortcuts

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