diff backend/arangodb/ArangoDb.py @ 256:f79be01821c4

Arangodb backend, first version which barely works for reading
author Dirk Olmes <dirk@xanthippe.ping.de>
date Wed, 30 Jan 2019 07:11:10 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/backend/arangodb/ArangoDb.py	Wed Jan 30 07:11:10 2019 +0100
@@ -0,0 +1,15 @@
+# -*- coding: utf-8 -*-
+
+class ArangoDb(object):
+    def __init__(self, database):
+        super(ArangoDb, self).__init__()
+        self.database = database
+
+    def get_or_create_collection(self, collection_name):
+        if self.database.hasCollection(collection_name):
+            return self.database[collection_name]
+        else:
+            return self.database.createCollection(name=collection_name)
+
+    def AQLQuery(self, query, bind_vars={}):
+        return self.database.AQLQuery(query, bindVars=bind_vars)
\ No newline at end of file