DBMySQLAdapter constructor

DBMySQLAdapter(
  1. String databaseName,
  2. String username, {
  3. String? host = 'localhost',
  4. Object? password,
  5. PasswordProvider? passwordProvider,
  6. int? port = 3306,
  7. int minConnections = 1,
  8. int maxConnections = 3,
  9. bool generateTables = false,
  10. bool checkTables = true,
  11. Object? populateTables,
  12. Object? populateSource,
  13. Object? populateSourceVariables,
  14. EntityRepositoryProvider? parentRepositoryProvider,
  15. String? workingPath,
  16. bool logSQL = false,
})

Implementation

DBMySQLAdapter(this.databaseName, this.username,
    {String? host = 'localhost',
    Object? password,
    PasswordProvider? passwordProvider,
    int? port = 3306,
    int minConnections = 1,
    int maxConnections = 3,
    super.generateTables,
    super.checkTables,
    super.populateTables,
    super.populateSource,
    super.populateSourceVariables,
    super.parentRepositoryProvider,
    super.workingPath,
    super.logSQL})
    : host = host ?? 'localhost',
      port = port ?? 3306,
      _password = (password != null && password is! PasswordProvider
          ? password.toString()
          : null),
      _passwordProvider = passwordProvider ??
          (password is PasswordProvider ? password : null),
      super(
        'mysql',
        minConnections,
        maxConnections,
        const DBSQLAdapterCapability(
            dialect: SQLDialect(
              'MySQL',
              elementQuote: '`',
              acceptsTemporaryTableForReturning: true,
              acceptsInsertIgnore: true,
            ),
            transactions: true,
            transactionAbort: true,
            tableSQL: true,
            constraintSupport: false,
            multiIsolateSupport: true),
      ) {
  boot();

  if (_password == null && _passwordProvider == null) {
    throw ArgumentError("No `password` or `passwordProvider` ");
  }

  boot();

  parentRepositoryProvider?.notifyKnownEntityRepositoryProvider(this);
}