Skip to content

Commit

Permalink
[Fix][Connector] Fix Dameng Connector (#301)
Browse files Browse the repository at this point in the history
  • Loading branch information
xxzuo authored Dec 4, 2023
1 parent 622a70e commit 2bbc315
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
public class DmConfigBuilder extends JdbcConfigBuilder{

@Override
protected InputParam getSchemaInput(boolean isEn) {
return getInputParam("schema",
protected InputParam getDatabaseInput(boolean isEn) {
return getInputParam("database",
isEn ? "schema" : "模式",
isEn ? "please enter schema, which is usually the same as the username" : "请填入模式, 一般和用户名相同", 1,
Validate.newBuilder().setRequired(true).setMessage(isEn ? "please enter schema" : "请填入模式").build(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,21 @@ protected ResultSet getMetadataDatabases(Connection connection) throws SQLExcept
// DM only need schema
return metaData.getSchemas();
}

@Override
protected ResultSet getMetadataTables(DatabaseMetaData metaData, String catalog, String schema) throws SQLException {
return metaData.getTables(null, catalog, null, TABLE_TYPES);
}

@Override
protected ResultSet getMetadataColumns(DatabaseMetaData metaData,
String catalog, String schema,
String tableName, String columnName) throws SQLException {
return metaData.getColumns(null, catalog, tableName, columnName);
}

@Override
protected ResultSet getPrimaryKeys(DatabaseMetaData metaData,String catalog, String schema, String tableName) throws SQLException {
return metaData.getPrimaryKeys(null, catalog, tableName);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,9 @@ public String getDriver() {
public boolean invalidateItemCanOutput() {
return false;
}

@Override
public String quoteIdentifier(String entity) {
return "\"" + entity + "\"";
}
}

0 comments on commit 2bbc315

Please sign in to comment.