view 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 source

# -*- 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)