gorm_mysql

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Client map[string]*gorm.DB
	// contains filtered or unexported fields
}

func NewDb

func NewDb(opts ...Option) *Client

func (*Client) DB

func (c *Client) DB(dbName ...string) (conn *gorm.DB)

type Option

type Option func(p *config)

func WithAttributes

func WithAttributes(attrs ...attribute.KeyValue) Option

WithAttributes configures attributes that are used to create a span.

func WithConnMaxIdleTime

func WithConnMaxIdleTime(connMaxIdleTime time.Duration) Option

WithConnMaxIdleTime connMaxIdleTime

func WithDBName

func WithDBName(name string) Option

WithDBName configures a db.name attribute.

func WithDNS

func WithDNS(dsn map[string]string) Option

WithDNS dsn

func WithDefaultStringSize

func WithDefaultStringSize(defaultStringSize uint) Option

WithDefaultStringSize defaultStringSize

func WithDisableDatetimePrecision

func WithDisableDatetimePrecision(disableDatetimePrecision bool) Option

WithDisableDatetimePrecision disableDatetimePrecision

func WithDontSupportRenameColumn

func WithDontSupportRenameColumn(dontSupportRenameColumn bool) Option

WithDontSupportRenameColumn dontSupportRenameColumn

func WithDontSupportRenameIndex

func WithDontSupportRenameIndex(dontSupportRenameIndex bool) Option

WithDontSupportRenameIndex dontSupportRenameIndex

func WithIgnoreRecordNotFoundError

func WithIgnoreRecordNotFoundError(ignoreRecordNotFoundError bool) Option

WithIgnoreRecordNotFoundError ignoreRecordNotFoundError

func WithLogger

func WithLogger(logger glog.ILogger) Option

WithLogger prevents logger.

func WithMaxIdleCons

func WithMaxIdleCons(maxIdleCons int) Option

WithMaxIdleCons maxIdleCons

func WithMaxOpenCons

func WithMaxOpenCons(maxOpenCons int) Option

WithMaxOpenCons maxOpenCons

func WithQueryFormatter

func WithQueryFormatter(queryFormatter func(query string) string) Option

WithQueryFormatter configures a query formatter

func WithSkipInitializeWithVersion

func WithSkipInitializeWithVersion(skipInitializeWithVersion bool) Option

WithSkipInitializeWithVersion skipInitializeWithVersion

func WithSlowThreshold

func WithSlowThreshold(slowThreshold time.Duration) Option

WithSlowThreshold slowThreshold

func WithTracer

func WithTracer(tracerServer *tracer.Server) Option

WithTracer tracerServer tracer.Server

func WithoutMetrics

func WithoutMetrics() Option

WithoutMetrics prevents DBStats metrics from being reported.

func WithoutQueryVariables

func WithoutQueryVariables() Option

WithoutQueryVariables configures the db.statement attribute to exclude query variables

Jump to

Keyboard shortcuts

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