Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

MySqlServerResource

Handle
📦 Aspire.Hosting.MySql v17.0.0

A resource that represents a MySQL container.

type MySqlServerResource interface {
ExpressionValue
IComputeResource
Resource
ResourceWithArgs
ResourceWithConnectionString
ResourceWithEndpoints
ResourceWithEnvironment
ResourceWithWaitSupport
}

Properties

propertyConnectionStringExpression*ReferenceExpressionget
Gets the connection string expression for the MySQL server.
ConnectionStringExpression() *ReferenceExpression
propertyDatabasesmap[string]stringget
A dictionary where the key is the resource name and the value is the database name.
Databases() (map[string]string, error)
propertyHostEndpointReferenceExpressionget
Gets the host endpoint reference for this resource.
Host() EndpointReferenceExpression
propertyJdbcConnectionString*ReferenceExpressionget
Gets the JDBC connection string for the MySQL server.
JdbcConnectionString() *ReferenceExpression
propertyPasswordParameterParameterResourceget · set
Gets or sets the parameter that contains the MySQL server password.
PasswordParameter() ParameterResource
SetPasswordParameter(value ParameterResource) MySqlServerResource
propertyPortEndpointReferenceExpressionget
Gets the port endpoint reference for this resource.
Port() EndpointReferenceExpression
propertyPrimaryEndpointEndpointReferenceget
Gets the primary endpoint for the MySQL server.
PrimaryEndpoint() EndpointReference
propertyResourceTypeDisplayNamestringget
Gets the ResourceTypeDisplayName property
ResourceTypeDisplayName() (string, error)
propertyUriExpression*ReferenceExpressionget
Gets the connection URI expression for the MySQL server.
UriExpression() *ReferenceExpression

Methods

methodAddDatabasebuilder
Adds a MySQL database to the application model.
AddDatabase(
name string,
options ...*AddDatabaseOptions,
) MySqlDatabaseResource
namestringThe name of the resource. This name will be used as the connection string name when referenced in a dependency.
options...*AddDatabaseOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*AddDatabaseOptions argument.

DatabaseName*stringThe name of the database. If not provided, this defaults to the same value as name.
MySqlDatabaseResource

The resource builder.

Returns a handle; failures surface later via Err().

methodWithDataBindMountbuilder
Adds a bind mount for the data folder to a MySql container resource.
WithDataBindMount(
source string,
options ...*WithDataBindMountOptions,
) MySqlServerResource
sourcestringThe source directory on the host to mount into the container.
options...*WithDataBindMountOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithDataBindMountOptions argument.

IsReadOnly*boolA flag that indicates if this is a read-only mount.
MySqlServerResource

The resource builder.

Returns a handle; failures surface later via Err().

methodWithDataVolumebuilder
Adds a named volume for the data folder to a MySql container resource.
WithDataVolume(options ...*WithDataVolumeOptions) MySqlServerResource
options...*WithDataVolumeOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithDataVolumeOptions argument.

Name*stringThe name of the volume. Defaults to an auto-generated name based on the application and resource names.
IsReadOnly*boolA flag that indicates if this is a read-only volume.
MySqlServerResource

The resource builder.

Returns a handle; failures surface later via Err().

methodWithInitFilesbuilder
Copies init files into a MySql container resource.
WithInitFiles(source string) MySqlServerResource
sourcestringThe source file or directory on the host to copy into the container.
MySqlServerResource

The resource builder.

Returns a handle; failures surface later via Err().

methodWithPasswordbuilder
Configures the password that the MySQL resource uses.
WithPassword(password ParameterResource) MySqlServerResource
passwordParameterResourceThe parameter used to provide the password for the MySQL resource.
MySqlServerResource

The resource builder.

Returns a handle; failures surface later via Err().

methodWithPhpMyAdminbuilder
Adds a phpMyAdmin administration and development platform for MySql to the application model.
WithPhpMyAdmin(options ...*WithPhpMyAdminOptions) MySqlServerResource
options...*WithPhpMyAdminOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithPhpMyAdminOptions argument.

ConfigureContainerfunc(obj PhpMyAdminContainerResource)callbackCallback to configure PhpMyAdmin container resource.
ContainerName*stringThe name of the container (Optional).
MySqlServerResource

The resource builder.

Returns a handle; failures surface later via Err().

methodWithReplbuilder
Adds a REPL command that opens an authenticated MySQL shell in the dashboard terminal dock.
WithRepl() MySqlServerResource
MySqlServerResource

The resource builder for chaining.

Returns a handle; failures surface later via Err().