Skip to content

Commit

Permalink
Merge branch 'master' into feat/data-loader/export-data-1
Browse files Browse the repository at this point in the history
  • Loading branch information
ypeckstadt authored Dec 19, 2024
2 parents 2c3798c + 8fb38aa commit aca0918
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1436,7 +1436,7 @@ jobs:
uses: gradle/actions/setup-gradle@v4

- name: Execute Gradle 'integrationTestJdbc' task
run: ./gradlew integrationTestJdbc ${{ matrix.mode.group_commit_enabled && env.INT_TEST_GRADLE_OPTIONS_FOR_GROUP_COMMIT || '' }}
run: ./gradlew integrationTestJdbc -Dscalardb.jdbc.url=jdbc:mariadb://localhost:3306 ${{ matrix.mode.group_commit_enabled && env.INT_TEST_GRADLE_OPTIONS_FOR_GROUP_COMMIT || '' }}

- name: Upload Gradle test reports
if: always()
Expand Down Expand Up @@ -1496,7 +1496,7 @@ jobs:
uses: gradle/actions/setup-gradle@v4

- name: Execute Gradle 'integrationTestJdbc' task
run: ./gradlew integrationTestJdbc ${{ matrix.mode.group_commit_enabled && env.INT_TEST_GRADLE_OPTIONS_FOR_GROUP_COMMIT || '' }}
run: ./gradlew integrationTestJdbc -Dscalardb.jdbc.url=jdbc:mariadb://localhost:3306 ${{ matrix.mode.group_commit_enabled && env.INT_TEST_GRADLE_OPTIONS_FOR_GROUP_COMMIT || '' }}

- name: Upload Gradle test reports
if: always()
Expand Down
5 changes: 3 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ subprojects {
sqlserverDriverVersion = '11.2.3.jre8'
sqliteDriverVersion = '3.47.1.0'
yugabyteDriverVersion = '42.7.3-yb-2'
mariadDbDriverVersion = '3.5.1'
picocliVersion = '4.7.6'
commonsTextVersion = '1.12.0'
junitVersion = '5.11.3'
commonsTextVersion = '1.13.0'
junitVersion = '5.11.4'
commonsLangVersion = '3.17.0'
assertjVersion = '3.26.3'
mockitoVersion = '4.11.0'
Expand Down
1 change: 1 addition & 0 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ dependencies {
implementation "com.microsoft.sqlserver:mssql-jdbc:${sqlserverDriverVersion}"
implementation "org.xerial:sqlite-jdbc:${sqliteDriverVersion}"
implementation "com.yugabyte:jdbc-yugabytedb:${yugabyteDriverVersion}"
implementation "org.mariadb.jdbc:mariadb-java-client:${mariadDbDriverVersion}"
implementation "org.apache.commons:commons-text:${commonsTextVersion}"
testImplementation "org.junit.jupiter:junit-jupiter-api:${junitVersion}"
testImplementation "org.junit.jupiter:junit-jupiter-params:${junitVersion}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public static RdbEngineStrategy create(JdbcConfig config) {
return new RdbEngineSqlite();
} else if (jdbcUrl.startsWith("jdbc:yugabytedb:")) {
return new RdbEngineYugabyte();
} else if (jdbcUrl.startsWith("jdbc:mariadb:")) {
return new RdbEngineMariaDB();
} else {
throw new IllegalArgumentException(
CoreError.JDBC_RDB_ENGINE_NOT_SUPPORTED.buildMessage(jdbcUrl));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.scalar.db.storage.jdbc;

import com.scalar.db.io.DataType;
import java.sql.Driver;
import java.sql.JDBCType;

class RdbEngineMariaDB extends RdbEngineMysql {
@Override
public Driver getDriver() {
return new org.mariadb.jdbc.Driver();
}

@Override
public DataType getDataTypeForScalarDb(
JDBCType type, String typeName, int columnSize, int digits, String columnDescription) {
if (type == JDBCType.BOOLEAN) {
// MariaDB JDBC driver maps TINYINT(1) type as a BOOLEAN JDBC type which differs from the
// MySQL driver which maps it to a BIT type.
return DataType.BOOLEAN;
} else {
return super.getDataTypeForScalarDb(type, typeName, columnSize, digits, columnDescription);
}
}
}

0 comments on commit aca0918

Please sign in to comment.