File size: 1,438 Bytes
ae01f49 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | ##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2024, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
##########################################################################
class SchemaDiffModel:
"""
SchemaDiffModel
"""
def __init__(self, **kwargs):
"""
This method is used to initialize the class and
create a proper object name which will be used
to fetch the data using namespace name and object name.
Args:
**kwargs : N number of parameters
"""
self._comparison_result = dict()
def clear_data(self):
"""
This function clear the model data.
"""
self._comparison_result.clear()
def set_result(self, node_name, compare_result):
"""
This method set the result of the comparision based on nodes.
"""
self._comparison_result[node_name] = compare_result
def get_result(self, node_name=None):
"""
This function will return the result for the node if specified
else return the complete result.
:param node_name: Name of the node ex: Database, Schema, etc..
:return:
"""
if node_name is not None:
return self._comparison_result[node_name]
return self._comparison_result
|