Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PgPassword ¶
PgPassword parses the ~/.pgpass file and gets the password for the given user. The current implementation ignores the location field.
func QueryStrings ¶
QueryStrings returns row maps (keyed by the column name) in a channel. Dynamically converts each column value to a SQL string value. See http://stackoverflow.com/questions/23507531/is-golangs-sql-package-incapable-of-ad-hoc-exploratory-queries
Types ¶
type DbInfo ¶
type DbInfo struct { DbName string DbHost string DbPort int32 DbUser string DbPass string DbSchema string DbOptions string }
DbInfo contains database connection info
func (*DbInfo) ConnectionString ¶
ConnectionString returns the string needed by the postgres driver library to connect
func (*DbInfo) Populate ¶
Populate populates the database connection info from environment variables or runtime flags. This calls flag.Parse(), so define any other program flags before calling this.
It is assumed that -V is the version flag, and -? is the help flag. These are assumed so we don't continue processing DB flags if one of these is set.