MCPcopy
hub / github.com/go-sql-driver/mysql / BeforeConnect

Function BeforeConnect

dsn.go:124–129  ·  view source on GitHub ↗

BeforeConnect sets the function to be invoked before a connection is established.

(fn func(context.Context, *Config) error)

Source from the content-addressed store, hash-verified

122
123// BeforeConnect sets the function to be invoked before a connection is established.
124func BeforeConnect(fn func(context.Context, *Config) error) Option {
125 return func(cfg *Config) error {
126 cfg.beforeConnect = fn
127 return nil
128 }
129}
130
131// EnableCompress sets the compression mode.
132func EnableCompression(yes bool) Option {

Callers 1

TestBeforeConnectFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestBeforeConnectFunction · 0.68