Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
model.py51 linesDownload Raw Back to schema_diff
1##########################################################################2#3# pgAdmin 4 - PostgreSQL Tools4#5# Copyright (C) 2013 - 2024, The pgAdmin Development Team6# This software is released under the PostgreSQL Licence7#8##########################################################################9 10 11class SchemaDiffModel:12    """13    SchemaDiffModel14    """15 16    def __init__(self, **kwargs):17        """18        This method is used to initialize the class and19        create a proper object name which will be used20        to fetch the data using namespace name and object name.21 22        Args:23            **kwargs : N number of parameters24        """25        self._comparison_result = dict()26 27    def clear_data(self):28        """29        This function clear the model data.30        """31        self._comparison_result.clear()32 33    def set_result(self, node_name, compare_result):34        """35        This method set the result of the comparision based on nodes.36        """37        self._comparison_result[node_name] = compare_result38 39    def get_result(self, node_name=None):40        """41        This function will return the result for the node if specified42        else return the complete result.43        :param node_name: Name of the node ex: Database, Schema, etc..44        :return:45        """46 47        if node_name is not None:48            return self._comparison_result[node_name]49 50        return self._comparison_result51 
codekingpro/portable-devtools · Team Ai