Documentation
¶
Index ¶
- Constants
- Variables
- func Close()
- func Gorm(ctxs ...context.Context) *gorm.DB
- func GormFrom(app *runtime.App) *gorm.DB
- func Init(cfg Config, mode string) error
- func InitWithConfig(cfg Config, mode string) error
- func PGX(ctxs ...context.Context) *pgxpool.Pool
- func PGXFrom(app *runtime.App) *pgxpool.Pool
- func PGXTransaction(ctx context.Context, fn func(tx pgx.Tx) error) error
- func Transaction(ctx context.Context, fn func(tx *gorm.DB) error) error
- func Use(opts ...UseOption) runtime.Capability
- type Config
- type ConfigLoader
- type Database
- type ModeLoader
- type UseOption
- func WithConfig(cfg Config) UseOption
- func WithConfigLoader(loader ConfigLoader) UseOption
- func WithDatabase(db *Database) UseOption
- func WithDependencies(deps ...runtime.Dependency) UseOption
- func WithExternal() UseOption
- func WithInternal() UseOption
- func WithMode(mode string) UseOption
- func WithModeLoader(loader ModeLoader) UseOption
Constants ¶
View Source
const Name = string(coredatabase.KeyDatabase)
Variables ¶
View Source
var ErrConfigRequired = errors.New("database facade: config or database required")
Functions ¶
func InitWithConfig ¶
func Use ¶
func Use(opts ...UseOption) runtime.Capability
Types ¶
type Config ¶
type Config = coredatabase.Config
type Database ¶
type Database = coredatabase.Database
type UseOption ¶
type UseOption func(*useOptions)
func WithConfig ¶
func WithConfigLoader ¶
func WithConfigLoader(loader ConfigLoader) UseOption
func WithDatabase ¶
func WithDependencies ¶
func WithDependencies(deps ...runtime.Dependency) UseOption
func WithExternal ¶ added in v0.1.4
func WithExternal() UseOption
func WithInternal ¶
func WithInternal() UseOption
func WithModeLoader ¶
func WithModeLoader(loader ModeLoader) UseOption
Click to show internal directories.
Click to hide internal directories.