diff options
| author | LV-426 <lv-426@taproot.org.il> | 2014-10-28 00:31:15 +0200 |
|---|---|---|
| committer | LV-426 <lv-426@taproot.org.il> | 2014-10-28 00:31:15 +0200 |
| commit | a4ec4c13f3dfaebe3e1b727108e7bc7e05b7fe2d (patch) | |
| tree | 430e5a2036f319ca532dd33f7070e39c814f9719 | |
| parent | 69d70685cfdea0ea6b6083d36f6fefd0be0741fe (diff) | |
DBO_cypher_query
| -rw-r--r-- | src-py/db_controller.py | 17 |
1 files changed, 15 insertions, 2 deletions
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 |
