PostgresBuilderExtensions.WithCreationScript Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Defines the SQL script used to create the database.
public static Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.ApplicationModel.PostgresDatabaseResource> WithCreationScript(this Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.ApplicationModel.PostgresDatabaseResource> builder, string script);
static member WithCreationScript : Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.ApplicationModel.PostgresDatabaseResource> * string -> Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.ApplicationModel.PostgresDatabaseResource>
<Extension()>
Public Function WithCreationScript (builder As IResourceBuilder(Of PostgresDatabaseResource), script As String) As IResourceBuilder(Of PostgresDatabaseResource)
Parameters
- builder
- IResourceBuilder<PostgresDatabaseResource>
The builder for the PostgresDatabaseResource.
- script
- String
The SQL script used to create the database.
Returns
A reference to the IResourceBuilder<T>.
Remarks
The script can only contain SQL statements applying to the default database like CREATE DATABASE. Custom statements like table creation and data insertion are not supported since they require a distinct connection to the newly created database. <returns>Default script is CREATE DATABASE "<QUOTED_DATABASE_NAME>"
</returns>