Skip to content
Docs Try Aspire

PostgresDatabaseResource

Handle TypeScript
📦 Aspire.Hosting.PostgreSQL v13.2.0-preview.1.26159.1
interface PostgresDatabaseResource
extends IManifestExpressionProvider,
IResource,
IResourceWithConnectionString,
IResourceWithParent,
0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]],
IValueProvider,
IValueWithReferences {
readonly connectionStringExpression: ReferenceExpression;
readonly databaseName: string;
readonly jdbcConnectionString: ReferenceExpression;
readonly name: string;
readonly parent: PostgresServerResource;
readonly uriExpression: ReferenceExpression;
withCreationScript(script: string): PostgresDatabaseResource;
withPostgresMcp(configureContainer?: (obj: PostgresMcpContainerResource) => void, containerName?: string): PostgresDatabaseResource;
}

Properties

property connectionStringExpression ReferenceExpression get
Gets the ConnectionStringExpression property
property databaseName string get
Gets the DatabaseName property
property jdbcConnectionString ReferenceExpression get
Gets the JdbcConnectionString property
property name string get
Gets the Name property
property parent PostgresServerResource get
Gets the Parent property
property uriExpression ReferenceExpression get
Gets the UriExpression property

Methods

method withCreationScript builder
Defines the SQL script for database creation
withCreationScript(script: string): PostgresDatabaseResource
script string
PostgresDatabaseResource
method withPostgresMcp builder
Adds Postgres MCP server
withPostgresMcp(configureContainer?: (obj: PostgresMcpContainerResource) => void, containerName?: string): PostgresDatabaseResource
configureContainer (obj: PostgresMcpContainerResource) => void optional
containerName string optional
PostgresDatabaseResource