MCPcopy Create free account
hub / github.com/DoNewsCode/core / WithDrivers

Function WithDrivers

otgorm/dependency_option.go:32–36  ·  view source on GitHub ↗

WithDrivers instructs the Providers to add new drivers or replace existing drivers. (By default, only "mysql", "sqlite", and "clickhouse" drivers are registered out of box.) For example, if SqlServer driver and mysql driver are need, we can pass in the following option WithDriver(map[string]func(ds

(drivers Drivers)

Source from the content-addressed store, hash-verified

30// need, we can pass in the following option
31// WithDriver(map[string]func(dsn string){"sqlserver": sqlServer.Open, "mysql": mysql.Open})
32func WithDrivers(drivers Drivers) ProvidersOptionFunc {
33 return func(options *providersOption) {
34 options.drivers = drivers
35 }
36}
37
38// WithReload toggles whether the factory should reload cached instances upon
39// OnReload event.

Callers 1

TestProvidersFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestProvidersFunction · 0.68