Module neug.query_result
The Neug result module.
QueryResult Objects
class QueryResult(object)QueryResult represents the result of a cypher query. Could be visited as a iterator.
It has the following methods to iterate over the results.
- hasNext(): Returns True if there are more results to iterate over.
- getNext(): Returns the next result as a list.
- length(): Returns the total number of results.
- get_result_schema(): Returns the schema of the result, which is a
yaml string describing the structure of the result.
>>> from neug import Database
>>> db = Database("/tmp/test.db", mode="r")
>>> conn = db.connect()
>>> result = conn.execute('MATCH (n) RETURN n')
>>> for row in result:
>>> print(row)
get_result_schema
def get_result_schema() -> strGet the schema of the result.
- Returns:
- str The schema of the result, which is a yaml string describing the structure of the result.
get_bolt_response
def get_bolt_response() -> strGet the result in Bolt response format.
- Returns:
- str The result in Bolt response format.