OtterMind/Chat2DB · error · BusinessException
database.delete.notSupportDbType
database.delete.notSupportDbType
Error message
database.delete.notSupportDbType
What it means
Thrown by requireSupportedDbType() when the normalized dbType (upper-cased, trimmed) is not in SUPPORTED_TYPES for the delete service. Deletion is only offered for specific dialects.
Source
Thrown at chat2db-community-server/chat2db-community-domain/chat2db-community-domain-core/src/main/java/ai/chat2db/community/domain/core/impl/db/DbDatabaseObjectDeleteServiceImpl.java:157
} catch (BusinessException e) {
throw e;
} catch (Exception e) {
throw new BusinessException("database.delete.executeFailed", new Object[]{e.getMessage()}, e);
}
}
private ConnectionProfile requireCurrentProfile() {
ConnectionProfile profile = connectionContextService.currentProfile();
if (profile == null) {
throw new BusinessException("database.delete.invalidDataSource");
}
return profile;
}
private String requireSupportedDbType(ConnectionProfile profile) {
String dbType = StringUtils.upperCase(StringUtils.trimToNull(profile.getDbType()));
if (!SUPPORTED_TYPES.contains(dbType)) {
throw new BusinessException("database.delete.notSupportDbType");
}
return dbType;
}
private void reconnectForDatabaseDelete(String dbType) {
if (!DatabaseTypeEnum.POSTGRESQL.name().equalsIgnoreCase(dbType)) {
return;
}
connectionContextService.rebindCurrentDatabase(maintenanceDatabase());
}
private String requireName(String name, String fieldName) {
String trimmed = StringUtils.trimToNull(name);
if (trimmed == null) {
throw new BusinessException("database.delete." + fieldName + "Required");
}
return trimmed;
}View on GitHub (pinned to 5ee1e990e7)
Solutions
- Use a supported database type for the delete operation; check SUPPORTED_TYPES for the current allow-list.
- If adding dialect support, register the type in SUPPORTED_TYPES and implement dropDatabase/dropSchema in its DbManager.
- Ensure profile.getDbType() is non-null and correctly cased.
Defensive patterns
Strategy: validation
Validate before calling
// Before delete
String dbType = StringUtils.upperCase(StringUtils.trimToNull(profile.getDbType()));
if (dbType == null || !SUPPORTED_TYPES.contains(dbType)) {
return Result.fail("database.delete.notSupportDbType");
} Prevention
- Offer deletion only for dbTypes in SUPPORTED_TYPES.
- Ensure profile.getDbType() is non-null and correctly cased.
- When adding a dialect, register its type in SUPPORTED_TYPES and implement drop logic.
When it happens
Trigger: A delete prepare/execute request runs against a datasource whose dbType is not in the supported set (e.g. a dialect like SQLite, H2, or a less-supported engine that the delete flow does not handle).
Common situations: User selects an unsupported datasource type for database/schema deletion; a new dialect plugin registered a type not yet added to SUPPORTED_TYPES; profile.dbType is null/blank (trimToNull yields null, not in the set).
Related errors
- database.delete.invalidDataSource
- database.delete.${fieldName}Required
- web.not.support.db.type
- database.delete.prepareFailed
- database.delete.connectionTargetsDeletedDatabase
AI-assisted analysis of OtterMind/Chat2DB@5ee1e990e7 (2026-08-14).
Data as JSON: /api/errors/019948324d52d232.
Report an issue: GitHub.