-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Recognize jdbc:edb urls as a distinct EnterpriseDB dialect (#2244)
* added new EnterpriseDB dialect support * Removed old/unused Postgresql DbTypes enum * Updated code to use standard "instanceof EnterpriseDBDatabase" style vs. getDbType() logic Co-authored-by: Nathan Voxland <nathan@voxland.net>
- Loading branch information
Showing
10 changed files
with
51 additions
and
39 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
liquibase-core/src/main/java/liquibase/database/core/EnterpriseDBDatabase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package liquibase.database.core; | ||
|
||
import liquibase.database.DatabaseConnection; | ||
import liquibase.exception.DatabaseException; | ||
import liquibase.statement.SqlStatement; | ||
import liquibase.statement.core.RawSqlStatement; | ||
|
||
public class EnterpriseDBDatabase extends PostgresDatabase { | ||
|
||
@Override | ||
public boolean isCorrectDatabaseImplementation(DatabaseConnection conn) throws DatabaseException { | ||
final String url = conn.getURL(); | ||
return url.contains("edb") || (url.contains("postgres") && url.contains(":5444")); | ||
} | ||
|
||
@Override | ||
public String getShortName() { | ||
return "edb"; | ||
} | ||
|
||
@Override | ||
public int getPriority() { | ||
return PRIORITY_DATABASE + 5; | ||
} | ||
|
||
|
||
@Override | ||
public String getDefaultDriver(String url) { | ||
if (url.startsWith("jdbc:edb:")) { | ||
return "com.edb.Driver"; | ||
} | ||
return null; | ||
} | ||
|
||
@Override | ||
public Integer getDefaultPort() { | ||
return 5444; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters