Skip to main content

GetPostgresDsn

Produces the DSN (data source name) for opening a postgres db connection.

def GetPostgresDsn(
ctx: context.Context,
pgConfig: PostgresConfig
) - > string

Produces the DSN (data source name) for opening a postgres db connection.

Parameters​

NameTypeDescription
ctxcontext.ContextThe context for the operation, used to resolve the password if it's dynamically sourced.
pgConfigPostgresConfigThe configuration object containing details like host, port, database name, user, and password information for the PostgreSQL connection.

Returns​

TypeDescription
stringThe DSN string for connecting to a PostgreSQL database.