def execute_insert(node): if not __check_power(node.type, [node.table_name]): return if not data_dict.has_table(node.table_name): print "Error: The table does not exist." return table = TableFile(data_dict, node.table_name, node.value_list) if not table.insert(index_dict): print "Error: Types are not matched or index duplicated" return index_dict.load_index()
def execute_insert(node): if not __check_power(node.type, [node.table_name]): return if not __check_table([node.table_name]): print("Error: This table isn't exists.") return data_dict = DataDict(node.table_name) table = TableFile(data_dict, node.table_name, node.value_list) print("node.table_name: ", node.table_name) if not table.insert(index_dict): print("Error: Types are not matched or Key error or index duplicated") return index_dict.load_index() # 加载索引