gorm

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProviderSet = wire.NewSet(New, NewOptions)

Functions

func New

func New(o *Options, tables []interface{}) (*gorm.DB, error)

New returns a new gorm.DB instance with options.

Types

type Options

type Options struct {
	User       string
	Password   string
	Host       string
	Port       int
	DBName     string
	Parameters string

	MaxIdleConnections int
	MaxOpenConnections int
	EnableAutoMigrate  bool
}

func NewOptions

func NewOptions(v *viper.Viper) (*Options, error)

NewOptions returns new log options.

func (*Options) DSN

func (o *Options) DSN() string

DSN returns data source name.

Jump to

Keyboard shortcuts

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