Documentation
¶
Overview ¶
Package connectorpostgresql has ready-made database/sql/driver.Connector for github.com/lib/pq.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewConnector ¶
Function NewConnector is a wrapper for github.com/lib/pq.
Input
- dsn: See Connection String Parameters.
Output
- driver.Connector configured for PostgreSQL.
Example ¶
package main import ( "context" "fmt" "github.com/senzing-garage/go-databasing/connectorpostgresql" ) func main() { // For more information, visit https://github.com/senzing-garage/go-databasing/blob/main/connectorpostgresql/connectorpostgresql_examples_test.go ctx := context.TODO() // See https://pkg.go.dev/github.com/lib/pq#hdr-Connection_String_Parameters configuration := "user=postgres password=postgres dbname=G2 host=localhost sslmode=disable" databaseConnector, err := connectorpostgresql.NewConnector(ctx, configuration) failOnError(err) _ = databaseConnector // Faux use of databaseConnector } func failOnError(err error) { if err != nil { fmt.Println(err) } }
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.