Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var PqErrors = map[string]*uerr.UError{ "unique_violation": uerr.NewError(uerr.ResourceAlreadyExistsError, "Resource already exists."), "not_null_violation": uerr.NewError(uerr.WrongInputParameterError, "Missing required value."), }
Functions ¶
Types ¶
type DBConfig ¶
type DBConfig struct { Host string `env:"POSTGRES_HOST" envDefault:"localhost"` Port string `env:"POSTGRES_PORT" envDefault:"5432"` User string `env:"POSTGRES_USER" envDefault:"postgres"` Password string `env:"POSTGRES_PASSWORD" envDefault:"postgres"` DatabaseName string `env:"POSTGRES_DATABASE" envDefault:"postgres"` SchemaName string `env:"POSTGRES_SCHEMA" envDefault:"public"` MigrationsDir string `env:"POSTGRES_MIGRATIONS_DIR" envDefault:"./migrations"` RunMigrationsOnReset bool `env:"POSTGRES_RUN_MIGRATIONS" envDefault:"false"` }
func NewDBConfigFromEnv ¶
func NewDBConfigFromEnv() *DBConfig
NewDBConfigFromEnv returns a *DBConfig initialized by env variables
func (*DBConfig) CreateSchema ¶
func (*DBConfig) GetConnectionString ¶
func (*DBConfig) SetEmptyValuesToDefaults ¶
func (c *DBConfig) SetEmptyValuesToDefaults()
func (*DBConfig) SetSearchPath ¶
type ResourcePage ¶
type Transactional ¶
type TransactionalMock ¶
func (*TransactionalMock) Rollback ¶
func (m *TransactionalMock) Rollback(ctx context.Context)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.