mirror of
				https://github.com/vran-dev/databasir.git
				synced 2025-11-04 08:22:28 +08:00 
			
		
		
		
	feat: add compatible when get databasemeta (#110)
This commit is contained in:
		@@ -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);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user