gorms

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: MIT Imports: 8 Imported by: 0

README

gormhelper

gorm helper package

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mysql

func Mysql(cfg Config) gorm.Dialector

func Open

func Open(option ...Option) (*gorm.DB, error)

func Postgres

func Postgres(cfg Config) gorm.Dialector

func SQLServer

func SQLServer(cfg Config) gorm.Dialector

func SQLite

func SQLite(cfg Config) gorm.Dialector

Types

type Config

type Config struct {
	Driver   string `mapstructure:"driver"`
	Address  string `mapstructure:"address"`
	User     string `mapstructure:"user"`
	Password string `mapstructure:"password"`
	Database string `mapstructure:"database"`
	Params   string `mapstructure:"param"`
}

type Helper

type Helper struct {
	// contains filtered or unexported fields
}

type Option

type Option func(helper *Helper)

func WithContext

func WithContext(ctx context.Context) Option

func WithDriver

func WithDriver(dialector gorm.Dialector) Option

func WithOption

func WithOption(opts ...gorm.Option) Option

Jump to

Keyboard shortcuts

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