Mercurial > hg > Feedworm
comparison 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 |
comparison
equal
deleted
inserted
replaced
255:b4c83e9b9c7a | 256:f79be01821c4 |
---|---|
1 # -*- coding: utf-8 -*- | |
2 | |
3 class ArangoDb(object): | |
4 def __init__(self, database): | |
5 super(ArangoDb, self).__init__() | |
6 self.database = database | |
7 | |
8 def get_or_create_collection(self, collection_name): | |
9 if self.database.hasCollection(collection_name): | |
10 return self.database[collection_name] | |
11 else: | |
12 return self.database.createCollection(name=collection_name) | |
13 | |
14 def AQLQuery(self, query, bind_vars={}): | |
15 return self.database.AQLQuery(query, bindVars=bind_vars) |