Skip to content
This repository has been archived by the owner on Jan 3, 2025. It is now read-only.

Latest commit

 

History

History
78 lines (58 loc) · 909 Bytes

README.adoc

File metadata and controls

78 lines (58 loc) · 909 Bytes

Database configuration

Environments

Env name Required Default value

DB_DIALECT

no

pgx

DB_HOST

yes

DB_PORT

no

5432

DB_NAME

yes

DB_SSL_MODE

no

disable

DB_MAX_IDLE_CONNECTIONS

no

5

DB_MAX_OPEN_CONNECTIONS

no

15

DB_MAX_LIFETIME_IN_MINUTES

no

15

DB_USER

yes

DB_PASSWORD

yes

SCHEMA_DB_USER

no

env value DB_USER

SCHEMA_DB_PASSWORD

no

env value DB_PASSWORD

GOOSE_MIGRATION_DIR

no

/db/migrations

Конвенция работы с БД из сервисов

  1. For entities, it is recommended to use the method TableName and extend from BaseEntity

    type MyEntity struct { BaseEntity }

    func (MyEntity) TableName() string { return "db-table-name" }