feat: add compatible when get databasemeta (#110)
This commit is contained in:
parent
ad4b1d9fe0
commit
b33cab86d9
|
@ -39,6 +39,22 @@ public class JdbcDatabaseMetaRepository implements DatabaseMetaRepository {
|
||||||
return Optional.of(meta);
|
return Optional.of(meta);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ResultSet schemas = metaData.getSchemas();
|
||||||
|
while (schemas.next()) {
|
||||||
|
String schemaName = schemas.getString("TABLE_SCHEM");
|
||||||
|
if (Objects.equals(condition.getSchemaName(), schemaName)) {
|
||||||
|
List<TableMeta> tableDocs = tableMetaRepository.selectTables(connection, condition);
|
||||||
|
DatabaseMeta meta = DatabaseMeta.builder()
|
||||||
|
.productName(metaData.getDatabaseProductName())
|
||||||
|
.productVersion(metaData.getDatabaseProductVersion())
|
||||||
|
.databaseName(condition.getDatabaseName())
|
||||||
|
.schemaName(condition.getSchemaName())
|
||||||
|
.tables(tableDocs)
|
||||||
|
.build();
|
||||||
|
return Optional.of(meta);
|
||||||
|
}
|
||||||
|
}
|
||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
throw new IllegalStateException(e);
|
throw new IllegalStateException(e);
|
||||||
|
|
Loading…
Reference in New Issue