Skip to content
DocsTry Aspire
DocsTry

PostgresDatabaseResource

Handle
📦 Aspire.Hosting.PostgreSQL v13.4.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 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.
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
scriptstring
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>optional
containerNamestringoptional
PostgresDatabaseResource