mysql

package
v0.0.0-...-081b122 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(dsn string)

Connect create db connection

func Migrate

func Migrate()

Migrate the db schema

Types

type Base

type Base struct {
	//ID []byte `gorm:"primary_key;unique_index;auto_increment:false"`
	//ID        uuid.UUID `gorm:"type:uuid;primary_key;"`
	ID        string    `gorm:"type:uuid;primary_key;type:char(36);column:id"`
	CreatedAt time.Time `gorm:"not null"`
	UpdatedAt time.Time
	DeletedAt *time.Time
}

func (*Base) BeforeCreate

func (b *Base) BeforeCreate(scope *gorm.Scope) error

type MySQL

type MySQL struct {
	*gorm.DB
}

MySQL refrence a mysql db

var DB MySQL

DB as the mysql client

Jump to

Keyboard shortcuts

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