postgresql

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2019 License: BSD-3-Clause Imports: 4 Imported by: 3 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// DriverName for postgres drivers
	DriverName = "postgres"
	// MasterQuery returns true when not in recovery (means node is master)
	MasterQuery = "select not pg_is_in_recovery();"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Hosts []Host
	// Params are parsed as `k=v` and appended to the connection string
	Params map[string]string
}

Config for postgreSQL drivers

func (Config) DataSourceNames

func (c Config) DataSourceNames() (snds []string)

DataSourceNames implements driver.Configurator

func (Config) DriverName

func (Config) DriverName() string

DriverName returns the DriverName constant. Implements driver.Configurator

func (Config) MasterQuery

func (Config) MasterQuery() string

MasterQuery returns the MasterQuery constant. Implements driver.Configurator

func (Config) WhiteList

func (Config) WhiteList(err error) bool

WhiteList returns true if the passed error is not a connection on DB consistency error. It used pq error codes for checking

type Host

type Host struct {
	// IP address, hostname or socket location
	Addr string
	// TCP port
	Port uint16
}

Host network information

Jump to

Keyboard shortcuts

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