Exemplo n.º 1
0
def cutcode(code):
    index = code.rfind(' ')
    completed = code[:index+1]
    partial = code[index+1:]

    print 'completed: "%s"' % completed
    print 'partial:   "%s"' % partial

    completions = CqlRuleSet.cql_complete(completed, partial, cassandra_conn=cqlkernel,
                                  startsymbol='cqlshCommand')
    print completions
Exemplo n.º 2
0
    print 'completed: "%s"' % completed
    print 'partial:   "%s"' % partial

    completions = CqlRuleSet.cql_complete(completed, partial, cassandra_conn=cqlkernel,
                                  startsymbol='cqlshCommand')
    print completions



cutcode("create")
cutcode("create ")
cutcode("create t")

# foo = cqlkernel.do_execute("select * from system.local xxx;", False)
foo = CqlRuleSet.cql_complete("CREATE", "", cassandra_conn=cqlkernel,
                                           startsymbol='cqlshCommand')

print foo
foo = CqlRuleSet.cql_complete("CREATE ", "T", cassandra_conn=cqlkernel,
                                           startsymbol='cqlshCommand')

print foo
foo = CqlRuleSet.cql_complete( "USE", "", cassandra_conn=cqlkernel,
                              startsymbol='cqlshCommand')


print foo

foo = CqlRuleSet.cql_complete( "", "CREATE", cassandra_conn=cqlkernel,
                              startsymbol='cqlshCommand')