PostgresDatabaseResource

Handle
📦 Aspire.Hosting.PostgreSQL v17.0.0
interface PostgresDatabaseResource
extends IExpressionValue,
IManifestExpressionProvider,
IResource,
IResourceWithConnectionString,
IResourceWithParent,
PostgresServerResource]],
IValueProvider,
IValueWithReferences {
readonly connectionStringExpression: ReferenceExpression;
readonly databaseName: string;
readonly jdbcConnectionString: ReferenceExpression;
readonly parent: PostgresServerResource;
readonly resourceTypeDisplayName: string;
readonly uriExpression: ReferenceExpression;
withCreationScript(script: string): PostgresDatabaseResource;
withPostgresMcp(configureContainer?: (obj: PostgresMcpContainerResource) => Promise<void>, containerName?: string): PostgresDatabaseResource;
}

Properties

propertyconnectionStringExpressionReferenceExpressionget
Gets the connection string expression for the Postgres database.
propertydatabaseNamestringget
Gets the database name.
propertyjdbcConnectionStringReferenceExpressionget
Gets the JDBC connection string for the PostgreSQL database.
propertyparentPostgresServerResourceget
Gets the parent PostgresSQL container resource.
propertyresourceTypeDisplayNamestringget
Gets the ResourceTypeDisplayName property
propertyuriExpressionReferenceExpressionget
Gets the connection URI expression for the PostgreSQL database.

Methods

methodwithCreationScriptbuilder
Defines the SQL script used to create the database.
withCreationScript(script: string): PostgresDatabaseResource
scriptstringThe SQL script used to create the database.
PostgresDatabaseResource
methodwithPostgresMcpbuilder
Adds a Postgres MCP server container and configures it to connect to the database represented by `builder`.
withPostgresMcp(configureContainer?: (obj: PostgresMcpContainerResource) => Promise<void>, containerName?: string): PostgresDatabaseResource
configureContainer(obj: PostgresMcpContainerResource) => Promise<void>optionalConfiguration callback for the Postgres MCP container resource.
containerNamestringoptionalThe name of the container (optional).
PostgresDatabaseResource