WaMysqlConfig constructor

WaMysqlConfig({
  1. String? host,
  2. int? port,
  3. String? user,
  4. String? pass,
  5. bool? secure = true,
  6. String? databaseName,
  7. String? collation,
  8. bool? enable,
})

Implementation

WaMysqlConfig({
  String? host,
  int? port,
  String? user,
  String? pass,
  bool? secure = true,
  String? databaseName,
  String? collation,
  bool? enable,
}) {
  this.user = user ?? env['MYSQL_USER'] ?? 'database_username';
  this.pass = pass ?? env['MYSQL_PASS'] ?? 'database_password';
  this.secure = secure ?? env['MYSQL_SECURE']?.toBool ?? true;
  this.host = host ?? env['MYSQL_HOST'] ?? 'localhost';
  this.port = port ?? env['MYSQL_PORT']?.toInt() ?? 3306;
  this.databaseName =
      databaseName ?? env['MYSQL_DATABASE'] ?? 'database_name';
  this.collation =
      collation ?? env['MYSQL_COLLATION'] ?? 'utf8mb4_general_ci';
  this.enable = enable ?? false;
}