postgres

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MigrationDir = "migrations"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PostgresDBConnector

type PostgresDBConnector struct {
	DSN       string
	TLSConfig *_tls.TLSConfig
	// contains filtered or unexported fields
}

func NewPostgresDBConnector

func NewPostgresDBConnector(
	dsn string,
	tlsConfig *_tls.TLSConfig,
) *PostgresDBConnector

func (*PostgresDBConnector) BuildDSNWithTLS

func (c *PostgresDBConnector) BuildDSNWithTLS() (string, error)

BuildDSNWithTLS builds a PostgreSQL DSN with SSL/TLS parameters based on the TLS configuration

func (*PostgresDBConnector) Connect

func (c *PostgresDBConnector) Connect() (*gorm.DB, error)

func (*PostgresDBConnector) DB

func (c *PostgresDBConnector) DB() *gorm.DB

func (*PostgresDBConnector) WithMaxRetries

func (c *PostgresDBConnector) WithMaxRetries(maxRetries int) *PostgresDBConnector

type PostgresMigrator

type PostgresMigrator struct {
	// contains filtered or unexported fields
}

func NewPostgresMigrator

func NewPostgresMigrator(db *gorm.DB) (*PostgresMigrator, error)

func (*PostgresMigrator) Down

func (m *PostgresMigrator) Down(steps *int) error

func (*PostgresMigrator) Migrate

func (m *PostgresMigrator) Migrate() error

func (*PostgresMigrator) Up

func (m *PostgresMigrator) Up(steps *int) error

Jump to

Keyboard shortcuts

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