diff --git a/plugin/src/main/java/com/databasir/core/meta/repository/impl/jdbc/JdbcDatabaseMetaRepository.java b/plugin/src/main/java/com/databasir/core/meta/repository/impl/jdbc/JdbcDatabaseMetaRepository.java index ebce9ab..0220ab6 100644 --- a/plugin/src/main/java/com/databasir/core/meta/repository/impl/jdbc/JdbcDatabaseMetaRepository.java +++ b/plugin/src/main/java/com/databasir/core/meta/repository/impl/jdbc/JdbcDatabaseMetaRepository.java @@ -39,6 +39,22 @@ public class JdbcDatabaseMetaRepository implements DatabaseMetaRepository { return Optional.of(meta); } } + + ResultSet schemas = metaData.getSchemas(); + while (schemas.next()) { + String schemaName = schemas.getString("TABLE_SCHEM"); + if (Objects.equals(condition.getSchemaName(), schemaName)) { + List 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(); } catch (SQLException e) { throw new IllegalStateException(e);