Skip to content

Commit

Permalink
Add DatabaseType POSTGRES for the product name EnterpriseDB
Browse files Browse the repository at this point in the history
Resolves #4627
  • Loading branch information
Sheel Prabhakar authored and fmbenhassine committed Sep 19, 2024
1 parent 8f7f37b commit 127ff8c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2006-2023 the original author or authors.
* Copyright 2006-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -103,6 +103,9 @@ else if (databaseProductName.contains("AS") && (databaseProductVersion.startsWit
databaseProductName = JdbcUtils.commonDatabaseName(databaseProductName);
}
}
else if (StringUtils.hasText(databaseProductName) && databaseProductName.startsWith("EnterpriseDB")) {
databaseProductName = "PostgreSQL";
}
else {
databaseProductName = JdbcUtils.commonDatabaseName(databaseProductName);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2008-2022 the original author or authors.
* Copyright 2008-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -138,6 +138,12 @@ void testFromMetaDataForPostgres() throws Exception {
assertEquals(POSTGRES, DatabaseType.fromMetaData(ds));
}

@Test
void testFromMetaDataForEnterpriseDB() throws Exception {
DataSource ds = DatabaseTypeTestUtils.getMockDataSource("EnterpriseDB");
assertEquals(POSTGRES, DatabaseType.fromMetaData(ds));
}

@Test
void testFromMetaDataForSybase() throws Exception {
DataSource ds = DatabaseTypeTestUtils.getMockDataSource("Adaptive Server Enterprise");
Expand Down

0 comments on commit 127ff8c

Please sign in to comment.