db

package
Version: v0.0.0-...-3b47b55 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoMigrateDB

func AutoMigrateDB(db *gorm.DB) error

func NewDB

func NewDB(config Config) (*gorm.DB, error)

New db connect to a database

Types

type Config

type Config struct {
	Driver          string
	DSN             string
	TablePrefix     string
	AutoMigrate     bool
	LogMode         bool
	MaxIdleConns    int
	MaxOpenConns    int
	ConnMaxLifetime int
}

func NewConfig

func NewConfig(driver, dsn, tablePrefix string, autoMigrate, logMode bool, maxIdelConns, maxOpenConns, connMaxLifetime int) Config

New db connect to a database

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL