Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support to TestContainers JDBC URL of Firebird #33952

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package org.apache.shardingsphere.infra.database.testcontainers.type;
import org.apache.shardingsphere.infra.database.core.type.DatabaseType;
import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader;

import java.util.Collection;
import java.util.Collections;
import java.util.Optional;

/**
* Database type of Firebird in testcontainers-java.
*/
public final class TcFirebirdDatabaseType implements TestcontainersDatabaseType {
@Override
public Collection<String> getJdbcUrlPrefixes() {
return Collections.singleton("jdbc:tc:firebird:");
}

@Override
public Optional<DatabaseType> getTrunkDatabaseType() {
return Optional.of(TypedSPILoader.getService(DatabaseType.class, "Firebird"));
}

@Override
public String getType() {
return "TC-Firebird";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ org.apache.shardingsphere.infra.database.testcontainers.type.TcOracleDatabaseTyp
org.apache.shardingsphere.infra.database.testcontainers.type.TcPostgreSQLDatabaseType
org.apache.shardingsphere.infra.database.testcontainers.type.TcSQLServerDatabaseType
org.apache.shardingsphere.infra.database.testcontainers.type.TcTiDBDatabaseType
org.apache.shardingsphere.infra.database.testcontainers.type.TcFirebirdDatabaseType
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ void assertGetJdbcUrlPrefixes() {
assertThat(TypedSPILoader.getService(DatabaseType.class, "TC-MySQL").getJdbcUrlPrefixes(), is(Collections.singleton("jdbc:tc:mysql:")));
assertThat(TypedSPILoader.getService(DatabaseType.class, "TC-Oracle").getJdbcUrlPrefixes(), is(Collections.singleton("jdbc:tc:oracle:")));
assertThat(TypedSPILoader.getService(DatabaseType.class, "TC-PostgreSQL").getJdbcUrlPrefixes(), is(Collections.singleton("jdbc:tc:postgresql:")));
assertThat(TypedSPILoader.getService(DatabaseType.class, "TC-Firebird").getJdbcUrlPrefixes(), is(Collections.singleton("jdbc:tc:firebird:")));
assertThat(TypedSPILoader.getService(DatabaseType.class, "TC-SQLServer").getJdbcUrlPrefixes(), is(Collections.singleton("jdbc:tc:sqlserver:")));
assertThat(TypedSPILoader.getService(DatabaseType.class, "TC-TiDB").getJdbcUrlPrefixes(), is(Collections.singleton("jdbc:tc:tidb:")));
}
Expand Down
Loading