Beispiel #1
0
    def query_record(self, sql_text, return_type=None, params={}):
        with session_scope(tx_mode=TxMode.NONE_TX,
                           ns_server_id=self.ns_server_id) as session:
            if return_type == 'List':
                self.row_result = select_rows_by_sql(sql_text,
                                                     params,
                                                     max_size=-1)
            else:
                self.row_result = session.execute(sql_text, params)

            return self.row_result
Beispiel #2
0
 def batch_update_record(self, batch_update_values, table_name, id):
     with session_scope(tx_mode=TxMode.NONE_TX,
                        ns_server_id=self.ns_server_id) as session:
         sql_util.batch_update(table_name, id, batch_update_values)