davebshow / aiogremlin

http://aiogremlin.readthedocs.org/en/latest/
Other
46 stars 13 forks source link

How to use transactions with the Client #7

Closed amyth closed 6 years ago

amyth commented 7 years ago

Hi I am using the latest stable version of aiogremlin to communicate with my janusgraph/cassandra implementation. I plan to create multiple vertices and edges in a write query and want to use transactions for such queries. How is the the use of transaction possible using aiogremlin client ?

davebshow commented 7 years ago

You can submit any string with the client, I think you are talking about doing something like this (untested):

import asyncio
import aiogremlin

loop = asyncio.get_event_loop()
cluster = await aiogremlin.Cluster.open(loop)
client = await cluster.connect()
result_set = await client.submit(
    '''g.addV("person")
       graph.tx().commit()''')
davebshow commented 6 years ago

Does this work for you?

davebshow commented 6 years ago

Closing due to inactivity.