db

package
v0.0.0-...-35d01cd Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoMigrate

func AutoMigrate(dst ...interface{}) error

func Init

func Init(t DbType, d string) error

func Transaction

func Transaction(f func(tdb *Database) error) error

Types

type BaseModel

type BaseModel struct {
	ID        uint `gorm:"primarykey"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt `gorm:"index"`
}

type Database

type Database struct {
	*gorm.DB
}
var DB *Database

type DbType

type DbType int
const (
	DB_Nil DbType = iota
	SQLite3
	Mysql
)

Jump to

Keyboard shortcuts

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