inthefabric / RexConnect

Connect to Rexster/RexPro via TCP connection.
www.inthefabric.com
Other
10 stars 0 forks source link

Zen Query input mode for Console #11

Open zachkinstner opened 11 years ago

zachkinstner commented 11 years ago

The standard Console is command-based:

# RexConnect> query
#   ...script (0; string): g
#   ...params (1; string; opt): 

{"timer":6,"results":["titangraph[local:data/FabricTest]"]}

# RexConnect> 

Queries are the most common thing you'll need to do, and it's quite tedious to type query+ENTER+g+ENTER+ENTER just to issue the query above.

With Zen Query mode, the prompt changes to something like...

# RexConnect Zen> 

...which expects a single query input. Hit ENTER to execute. Ah, that's much better.

# RexConnect Zen> g

{"timer":6,"results":["titangraph[local:data/FabricTest]"]}

# RexConnect Zen> g
zachkinstner commented 11 years ago

Parameterized Queries

Zen Query mode uses a _P# parameter naming convention. This allows you to quickly enter parameter values, instead of manually typing the JSON parameter map. Ain't nobody got time for that.

# RexConnect Zen> g.addVertex([ThingId:_P0, Name:_P1, Desc:_P2])
#   P0> 1234
#   P1> "My Name"
#   P2> "This is a good thing."

{"timer":149,"results":[{"_properties":{"ThingId":123,"Name":"My Name","Desc":"This is a good thing."},"_id":"560004","_type":"vertex"}]}