mpgutil

package
v0.5.10 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultUsername       = "fly-user"
	DefaultDatabase       = "fly-db"
	DefaultPort           = 5432
	DefaultPGMajorVersion = "16"
)

Defaults for a Managed Postgres cluster.

Variables

This section is empty.

Functions

func AvailableRegionCodes

func AvailableRegionCodes(ctx context.Context) ([]string, error)

AvailableRegionCodes returns the codes of AvailableRegions.

func AvailableRegions

func AvailableRegions(ctx context.Context) ([]fly.Region, error)

AvailableRegions returns the non-deprecated regions where Managed Postgres is available, per the Machines API region list (fly.Region.MPGAvailable).

func ConnectionURI

func ConnectionURI(c flaps.ManagedPostgresCluster, password string) string

ConnectionURI builds a libpq connection string for the cluster's default user and database via the pooler endpoint, using the given password. The API returns no connection string, so flyctl assembles it client-side.

func IsValidRegion

func IsValidRegion(ctx context.Context, regionCode string) (bool, error)

IsValidRegion reports whether Managed Postgres is available in the given region code.

func PsqlProxyContext added in v0.5.9

func PsqlProxyContext(ctx context.Context, o PsqlOptions) context.Context

PsqlProxyContext keeps diagnostics off psql's stdout for non-interactive or scripted sessions.

func RunPsql added in v0.5.9

func RunPsql(ctx context.Context, psqlPath, connectURL string, options PsqlOptions) error

RunPsql runs psql against connectURL and waits for it. Interrupts are forwarded to psql so Ctrl+C cancels the running query; a second one within two seconds ends the session.

Types

type PsqlOptions added in v0.5.9

type PsqlOptions struct {
	Commands  []string
	Files     []string
	ExtraArgs []string
}

PsqlOptions describes SQL input and arguments passed through to psql.

func PsqlOptionsFromContext added in v0.5.9

func PsqlOptionsFromContext(ctx context.Context) PsqlOptions

PsqlOptionsFromContext reads the SQL flags and arguments passed through to psql.

func (PsqlOptions) Scripted added in v0.5.9

func (o PsqlOptions) Scripted() bool

Scripted reports whether SQL was supplied with --command or --file.

Jump to

Keyboard shortcuts

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