Class DiffTree

java.lang.Object
org.pgcodekeeper.core.model.difftree.DiffTree

public final class DiffTree extends Object
Utility class for creating and managing diff trees that represent differences between database schemas.
  • Method Details

    • create

      public static TreeElement create(ISettings settings, AbstractDatabase left, AbstractDatabase right) throws InterruptedException
      Creates a diff tree comparing two database schemas.
      Parameters:
      settings - the compare settings
      left - the left (old) database schema
      right - the right (new) database schema
      Returns:
      the root TreeElement representing the diff tree
      Throws:
      InterruptedException - if the operation is interrupted
    • create

      public static TreeElement create(ISettings settings, AbstractDatabase left, AbstractDatabase right, IMonitor monitor) throws InterruptedException
      Creates a diff tree comparing two database schemas with progress monitoring.
      Parameters:
      settings - the compare settings
      left - the left (old) database schema
      right - the right (new) database schema
      monitor - the progress monitor for tracking operation progress
      Returns:
      the root TreeElement representing the diff tree
      Throws:
      InterruptedException - if the operation is interrupted
    • addColumns

      @Deprecated public static void addColumns(List<AbstractColumn> left, List<AbstractColumn> right, TreeElement parent, List<TreeElement> list)
      Deprecated.
      this method is deprecated
      Adds column differences to the tree element list.
      Parameters:
      left - the left (old) column list
      right - the right (new) column list
      parent - the parent tree element
      list - the list to add column differences to
    • getTablesWithChangedColumns

      public static Set<TreeElement> getTablesWithChangedColumns(AbstractDatabase oldDbFull, AbstractDatabase newDbFull, List<TreeElement> selected)
      Gets tables that have changed columns from the selected elements.
      Parameters:
      oldDbFull - the old database schema
      newDbFull - the new database schema
      selected - the list of selected tree elements
      Returns:
      a set of table elements that have changed columns
    • createTree

      public TreeElement createTree(AbstractDatabase left, AbstractDatabase right) throws InterruptedException
      Creates a diff tree by comparing two database schemas and building a hierarchical tree structure representing the differences between them.
      Parameters:
      left - the left (old) database schema to compare
      right - the right (new) database schema to compare
      Returns:
      the root TreeElement representing the complete diff tree with "Database" as the root node and all schema differences as child nodes
      Throws:
      InterruptedException - if the operation is cancelled via the progress monitor