DBPostgreSQLAdapter constructor

DBPostgreSQLAdapter(
  1. String databaseName,
  2. String username, {
  3. String? host = 'localhost',
  4. Object? password,
  5. PasswordProvider? passwordProvider,
  6. int? port = 5432,
  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

DBPostgreSQLAdapter(this.databaseName, this.username,
    {String? host = 'localhost',
    Object? password,
    PasswordProvider? passwordProvider,
    int? port = 5432,
    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 ?? 5432,
      _password = (password != null && password is! PasswordProvider
          ? password.toString()
          : null),
      _passwordProvider = passwordProvider ??
          (password is PasswordProvider ? password : null),
      super(
        'postgresql',
        minConnections,
        maxConnections,
        const DBSQLAdapterCapability(
            dialect: SQLDialect(
              'PostgreSQL',
              elementQuote: '"',
              acceptsReturningSyntax: true,
              acceptsInsertDefaultValues: true,
              acceptsInsertOnConflict: true,
              acceptsVarcharWithoutMaximumSize: true,
            ),
            transactions: true,
            transactionAbort: true,
            tableSQL: true,
            constraintSupport: true,
            multiIsolateSupport: true),
      ) {
  boot();

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

  parentRepositoryProvider?.notifyKnownEntityRepositoryProvider(this);
}