qualifierFor method

String? qualifierFor(
  1. String tenant, {
  2. String base = 'dartvel',
})

The database or schema name for tenant under the configured isolation.

Under DVTenantIsolation.sharedDatabase there is nothing to qualify, so this returns null and callers scope by column instead.

Implementation

String? qualifierFor(String tenant, {String base = 'dartvel'}) {
  switch (_isolation) {
    case DVTenantIsolation.sharedDatabase:
      return null;
    case DVTenantIsolation.schemaPerTenant:
    case DVTenantIsolation.databasePerTenant:
      return '${base}_${_slug(tenant)}';
  }
}