Class MySqlDatasourceConnection
- Namespace
- YndigoBlue.Velocity.Connections
- Assembly
- YndigoBlue.Velocity.dll
Connection configuration for MySQL databases.
public class MySqlDatasourceConnection : DatasourceConnection, IDatasourceConnection
- Inheritance
-
MySqlDatasourceConnection
- Implements
Examples
// Connect to MySQL with standard configuration
var conn = new MySqlDatasourceConnection
{
Hostname = "localhost",
Port = 3306,
Database = "mydatabase",
Username = "root",
Password = "mypassword"
};
using (var m = new Manager(conn))
{
var schema = m.LoadSchema("mydatabase");
// Perform database operations
}
Remarks
Supports MySQL 8.0 and later versions.
Default port: 3306
Includes geospatial support with distance calculations and SRID transformations.
Properties
- AllowLoadLocalInfile
Gets or sets whether to allow LOAD DATA LOCAL INFILE statements. Default is true.
- AllowUserVariables
Gets or sets whether to allow user-defined variables. Default is true.
- DatasourceType
Gets the datasource type for MySQL.
- LengthUnit
Gets or sets the unit of measurement for distance calculations (e.g., "metre", "kilometer"). Default is "metre".
- ProjectionAdjustment
Gets or sets the projection adjustment factor for distance calculations. Default is 1.
- ReservedSettings
Gets the reserved connection string settings that are handled by named properties.
- TransformSrid
Gets or sets the target SRID for spatial transformations. Default is 4326 (WGS 84).