Skip to content

Commit

Permalink
Reset catalog for table references
Browse files Browse the repository at this point in the history
  • Loading branch information
sualeh committed Jul 18, 2023
1 parent ccaacfc commit d848852
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
import java.util.Optional;
import java.util.function.Function;
import schemacrawler.schema.Table;
import schemacrawler.schemacrawler.SchemaCrawlerOptionsBuilder;
import schemacrawler.utility.MetaDataUtility;

public final class TableReferencesFunctionDefinition
extends AbstractFunctionDefinition<TableReferencesFunctionParameters> {
Expand All @@ -46,6 +48,9 @@ public TableReferencesFunctionDefinition() {
@Override
public Function<TableReferencesFunctionParameters, FunctionReturn> getExecutor() {
return args -> {
// Re-filter catalog
MetaDataUtility.reduceCatalog(catalog, SchemaCrawlerOptionsBuilder.newSchemaCrawlerOptions());

final Optional<Table> firstMatchedTable =
catalog.getTables().stream()
.filter(table -> table.getName().matches("(?i)" + args.getTableName()))
Expand Down

0 comments on commit d848852

Please sign in to comment.