Help us shape the future of Go! Take the 2026 Go Developer Survey

pgengine

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package pgengine holds the connection setup the postgresql and alloydb plugins share, so their engines connect the same way.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IAMUser

func IAMUser(email string) string

IAMUser returns the database user name Cloud SQL and AlloyDB give an IAM principal: a service account's email without its ".gserviceaccount.com" suffix, and any other email unchanged.

func PoolConfig

func PoolConfig(user, password, database string, iam bool) (*pgxpool.Config, error)

PoolConfig returns the pool configuration for a connection that a Cloud SQL or AlloyDB connector dials. The credentials go into the config's fields rather than a connection string, so a value with spaces or quotes reaches the server intact. TLS is off at this layer because the connector encrypts the connection itself, and an IAM login sends no password because the connector authenticates it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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