Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrEmptyCreationStatement = errors.New("empty creation statements") ErrEmptyRotationStatement = errors.New("empty rotation statements") )
Functions ¶
func ParseURL ¶ added in v0.5.0
ParseURL no longer needs to be used by clients of this library since supplying a URL as a connection string to sql.Open() is now supported:
sql.Open("postgres", "postgres://bob:secret@1.2.3.4:5432/mydb?sslmode=verify-full")
It remains exported here for backwards-compatibility.
ParseURL converts a url to a connection string for driver.Open. Example:
"postgres://bob:secret@1.2.3.4:5432/mydb?sslmode=verify-full"
converts to:
"user=bob password=secret host=1.2.3.4 port=5432 dbname=mydb sslmode=verify-full"
A minimal example:
"postgres://"
This will be blank, causing driver.Open to use all of the defaults
func QueryHelper ¶
Query templates a query for us.
func QuoteIdentifier ¶ added in v0.5.0
QuoteIdentifier quotes an "identifier" (e.g. a table or a column name) to be used as part of an SQL statement. For example:
tblname := "my_table" data := "my_data" quoted := pq.QuoteIdentifier(tblname) err := db.Exec(fmt.Sprintf("INSERT INTO %s VALUES ($1)", quoted), data)
Any double quotes in name will be escaped. The quoted identifier will be case sensitive when used in a query. If the input string contains a zero byte, the result will be truncated immediately before it.
func StatementCompatibilityHelper ¶
func StatementCompatibilityHelper(statements dbplugin.Statements) dbplugin.Statements
StatementCompatibilityHelper will populate the statements fields to support compatibility
func Unimplemented ¶ added in v0.1.12
func Unimplemented() error
Unimplemented returns a gRPC error with the Unimplemented code
Types ¶
This section is empty.