postgres

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Flags

type Flags struct {
	Host     string `kong:"optional,group='Postgres',name=postgres-host,default=localhost,env=POSTGRES_HOST,help='PostgreSQL address host.'"`
	Port     uint32 `kong:"optional,group='Postgres',name=postgres-port,default=5432,env=POSTGRES_PORT,help='PostgreSQL address port.'"`
	Username string `kong:"optional,group='Postgres',name=postgres-username,default=postgres,env=POSTGRES_USERNAME,help='PostgreSQL username.'"`
	Password string `kong:"optional,group='Postgres',name=postgres-password,env=POSTGRES_PASSWORD,help='PostgreSQL password.'" json:"-"`
	Database string `kong:"optional,group='Postgres',name=postgres-database,default=postgres,env=POSTGRES_DATABASE,help='PostgreSQL database.'"`

	TLSMode string `kong:"optional,group='Postgres',name=postgres-tls-mode,default=disable,env=POSTGRES_TLS_MODE,help='PostgreSQL TLS mode.'"`
}

Flags represents PostgreSQL connection flags and provides methods to open a connection to the database.

func (Flags) BuildConnectionString

func (p Flags) BuildConnectionString() string

func (Flags) OpenStdSQLDB

func (p Flags) OpenStdSQLDB() (*sql.DB, error)

OpenStdSQLDB opens a new connection to the PostgreSQL database using the standard library's sql package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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