PostgreSqlContainer Class

A temporary PostgreSQL container. Obtain one from PostgreSqlContainerDefinition.CreateContainer.

public sealed class PostgreSqlContainer : TemporaryContainer
Inheritance
TemporaryContainer PostgreSqlContainer

Methods

NameDescription
GetConnectionString()Gets an Npgsql connection string for the running container (on TemporaryContainer.GetHostAddress), using the credentials from the definition's environment variables (POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB).

GetConnectionString()

PostgreSqlContainer.cs

Gets an Npgsql connection string for the running container (on TemporaryContainer.GetHostAddress), using the credentials from the definition's environment variables (POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB).

public string GetConnectionString()

Returns

string The connection string.

Exceptions

InvalidOperationException
The container has not been started.