db

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigRepo

type ConfigRepo[T config.TenantId, V any] struct {
	ConfigKey string
	Conn      *sqlx.DB
}

func RegisterConfigForDbOps

func RegisterConfigForDbOps[T config.TenantId, V any](conn *sqlx.DB, configKey string) *ConfigRepo[T, V]

func (*ConfigRepo[T, V]) GetConfigByKeyForEntity

func (c *ConfigRepo[T, V]) GetConfigByKeyForEntity(ctx context.Context, entityId T) (*V, error)

func (*ConfigRepo[T, V]) SaveConfig

func (c *ConfigRepo[T, V]) SaveConfig(ctx context.Context, config *config.Config[T, V]) (int64, error)

type IConfigDbRepo

type IConfigDbRepo[T config.TenantId, V any] interface {
	SaveConfig(ctx context.Context, config *config.Config[T, V]) (int64, error)
	GetConfigByKeyForEntity(ctx context.Context, entityId T) (*V, error)
}

Jump to

Keyboard shortcuts

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