From a4ec4c13f3dfaebe3e1b727108e7bc7e05b7fe2d Mon Sep 17 00:00:00 2001 From: LV-426 Date: Tue, 28 Oct 2014 00:31:15 +0200 Subject: DBO_cypher_query --- src-py/db_controller.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src-py/db_controller.py') diff --git a/src-py/db_controller.py b/src-py/db_controller.py index f9656212..f43c9673 100644 --- a/src-py/db_controller.py +++ b/src-py/db_controller.py @@ -114,6 +114,14 @@ class DB_composed_op(DB_op): ret.append(s_result_set) return ret +class DBO_cypher_query(DB_op): + """ + freeform cypher query + """ + def __init__(self, q, q_params={}): + super(DBO_cypher_query, self).__init__() + self.add_statement(q, q_params) + class DBO_topo_diff_commit(DB_composed_op): """ commit a Topo_Diff @@ -384,8 +392,13 @@ class DB_Controller: def exec_cypher_query(self, q): """ - @deprecated: use transaction based api + @deprecated: use DBO_cypher_query """ # call post and not db_util.post_neo4j to avoid response key errors - db_util.post(self.config.db_base_url + '/db/data/cypher', {"query" : q}) + try: + db_util.post(self.config.db_base_url + '/db/data/cypher', {"query" : q}) + except Exception as e: + log.error(e.message) + log.error(traceback.print_exc()) + raise e -- cgit v1.3.1