gormutil

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: MIT Imports: 9 Imported by: 0

README

postgres

driver: postgres
dsn: user=postgres password=123456 dbname=databasename host=127.0.0.1 port=5432 sslmode=disable TimeZone=Asia/Shanghai

mysql

driver: mysql
dsn: root:123456@tcp(127.0.0.1:3306)/dbname?parseTime=True

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoMigrate

func AutoMigrate(models []interface{})

func DB

func DB() *gorm.DB

func Init

func Init(conf Config, debug bool)

func New

func New(debug bool, conf Config) (*gorm.DB, error)

Types

type Config

type Config struct {
	Driver string `yaml:"driver"`
	DSN    string `yaml:"dsn"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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