ParentDriver
The ParentDriver class provides some general class methods available to all other mako drivers.
ParentDriver.close()
Closes the connection to the database.
ParentDriver.query(query, batch=None)
ParentDriver.write(query, batch=None)
Accepts a query (read or write) and provides the results. For batch queries, the batch parameter should contain a list of dictionaries, where each dictionary contains a key: value pair where the key matches a key in the Cypher query.
Batch queries should unwind the batch, like so:
query = "WITH $batch as batch " \
"UNWIND batch as record " \
"MERGE (a:Taxon {name:record.taxon}) RETURN a"
The string after record (here taxon) needs to match a dictionary key.
- query: String containing Cypher query
- batch: List of dictionaries for batch queries