mysql

package
v0.0.0-...-d283dcf Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Default *gorm.DB
)

Functions

func Init

func Init() (err error)

Init initializes the default MySQL connection. It checks if MySQL is enabled and selected as the default database. If the connection is successful, it initializes the database and returns nil.

func New

func New(cfg config.MySQL) (*gorm.DB, error)

New creates and returns a new MySQL database connection with the given configuration. The returned handle already carries the GORM OpenTelemetry tracing plugin, so application-held instances passed to DatabaseOn, AggregateOn, and TransactionOn are traced like the default database.

Types

This section is empty.

Jump to

Keyboard shortcuts

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