postgresql

package
v0.0.0-...-4be293a Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ComponentName = "postgresql"
)

Variables

This section is empty.

Functions

func NewNullInt32

func NewNullInt32(num *int32) sql.NullInt32

func NewNullInt64

func NewNullInt64(num *int64) sql.NullInt64

func NewNullString

func NewNullString(str *string) sql.NullString

func NewNullTimeFromPbTimestamp

func NewNullTimeFromPbTimestamp(timestamp *timestamppb.Timestamp) sql.NullTime

func NewNullUUID

func NewNullUUID(uuidStr *string) uuid.NullUUID

Types

type Component

type Component struct {
	Connection *pgxpool.Pool
	// contains filtered or unexported fields
}

func NewComponent

func NewComponent(opts ...ComponentOption) *Component

func (*Component) Health

func (c *Component) Health() error

Health implements the Component interface.

func (*Component) Name

func (c *Component) Name() string

Name implements the Component interface.

func (*Component) Start

func (c *Component) Start() error

Start implements the Component interface.

func (*Component) Stop

func (c *Component) Stop() error

Stop implements the Component interface.

type ComponentOption

type ComponentOption func(*Component)

ComponentOption is an option to `PostgreSQLComponent`.

func WithDatabaseURL

func WithDatabaseURL(databaseURL string) ComponentOption

WithDatabaseURL sets the database URL for the PostgreSQL component.

func WithLogger

func WithLogger(logger *logrus.Entry) ComponentOption

WithLogger sets the logger for the PostgreSQL component.

func WithPoolSize

func WithPoolSize(poolSize int) ComponentOption

WithPoolSize sets the pool size for the PostgreSQL component.

Jump to

Keyboard shortcuts

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