Documentation
¶
Index ¶
- func QuoteString(str string) string
- type Config
- type Repo
- func (db *Repo) ConnectDB(ctx context.Context, tlsConfig *tls.Config) (*pgxpool.Pool, error)
- func (db *Repo) DebugLogSqlErr(q string, err error) error
- func (db *Repo) GetPgxConfig() (*pgxpool.Config, error)
- func (db *Repo) GetPgxConnString() string
- func (db *Repo) GracefulShutdown()
- func (db *Repo) PoolFromString(ctx context.Context, connString string) (*pgxpool.Pool, error)
- func (db *Repo) SanitizeString(str string) string
- type SSL
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func QuoteString ¶
according to https://github.com/jackc/pgx/blob/master/conn.go#L84 have to watch changes, to prevent internal issues
Types ¶
type Config ¶ added in v0.6.0
type Config struct {
ConnString string `json:"conn_string" yaml:"conn_string"`
ActualSchema string `json:"actual_schema" yaml:"schema_path"`
MigrationSchema string `json:"migration_schema" yaml:"migration_schema_path"`
DataDir string `json:"data_dir" yaml:"data_dir"`
Host string `json:"host" yaml:"host"`
Port string `json:"port" yaml:"port"`
Name string `json:"name" yaml:"name"`
User string `json:"user" yaml:"user"`
Password string `json:"password" yaml:"password"`
SslMode string `json:"ssl_mode" yaml:"ssl_mode"`
TLS SSL `json:"tls" yaml:"tls"`
TLSConfig *tls.Config `json:"-" yaml:"-"`
}
type Repo ¶
type Repo struct {
Logger *zap.SugaredLogger `json:"-" yaml:"-"`
Pool *pgxpool.Pool `json:"-" yaml:"-"`
Config *Config `json:"-" yaml:"-"`
}
func (*Repo) DebugLogSqlErr ¶ added in v0.2.1
handleSqlErr used to avoid not exists and already exists debug queries
func (*Repo) GetPgxConnString ¶ added in v0.6.0
func (*Repo) GracefulShutdown ¶
func (db *Repo) GracefulShutdown()
func (*Repo) PoolFromString ¶
func (*Repo) SanitizeString ¶
Click to show internal directories.
Click to hide internal directories.