all

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Component = &component.Component{
	Dependencies: component.Components{
		manager.Component,
		migrator.Component,
		sqlGenerator.Component,
		mysql.Component,
	},
	Configuration: component.StepFunc(func(container container.Container) error {
		return container.Invoke(func(managerCfg dbClient.Config, migratorCfg *dbMigrator.Config, generatorCfg *dbSqlGenerator.Config) {
			if managerCfg.Driver != mysql.MySQL {
				return
			}

			migratorCfg.Driver = mysql.MySQL
			generatorCfg.Driver = mysql.MySQL
		})
	}),
}

Component is a complete MySQL integration that automatically:

  • Provides the MySQL client
  • Registers MySQL with db-client
  • Registers MySQL migration driver with db-migrator
  • Registers MySQL dialect with db-sql-generator
  • Automatically propagates driver selection to all components

Usage (recommended for single-database applications):

compogo.WithComponents(
    db_client.Component,
    db_migrator.Component,
    db_sql_generator.Component,
    mysql.Component,
    all.Component,  // ← everything automatically wired
)

Then just select the driver via flag:

./myapp --db.driver=mysql --db.mysql.dsn="..."

The migrator and SQL generator will automatically use the same driver.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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