FinchMysqlConfig constructor

FinchMysqlConfig({
  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

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