Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DryRun ¶
DryRun returns a handle on the MySQL dialect that never connects: gorm's dry-run mode builds statements without running them, the version query of the dialect's initialization is skipped and no ping is made. It answers schema questions where no server is at hand, above all the column type a field gets on MySQL: the column inspection gg builds into a project validates the models' index declarations against it (see model.ValidateIndexes), which is how gg check refuses a declaration MySQL cannot honor without a database. The handle logs nothing, since it runs nothing.
func Init ¶
func Init() error
Init opens the default MySQL connection when MySQL is enabled and selected as the default database, and makes it the default database that database.Database and database.DB use; otherwise it does nothing.
func New ¶
New creates and returns a new MySQL database connection with the given configuration. With tracing configured on, the returned handle carries the GORM OpenTelemetry tracing plugin, so application-held instances passed to DatabaseOn, SelectOn, UnionAllOn, TransactionOn, and CleanupOn are traced like the default database. The pool runs under the connection limits of the [database] configuration, the same ones the default handle runs under.
Types ¶
This section is empty.