[ 
https://issues.apache.org/jira/browse/CASSANDRA-8021?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14163477#comment-14163477
 ] 

Rajanarayanan Thottuvaikkatumana edited comment on CASSANDRA-8021 at 10/8/14 
1:34 PM:
--------------------------------------------------------------------------------------

Here is the code snippet that does the job for in the version 2.1.1. Please let 
me know whether this is good. 
{code:title=cql3handline.py|borderStyle=solid}
syntax_rules += r'''
<alterKeyspaceStatement> ::= "ALTER" wat=( "KEYSPACE" | "SCHEMA" ) 
ks=<alterableKeyspaceName>
                                 "WITH" <property> ( "AND" <property> )*
                           ;
'''
@completer_for('alterKeyspaceStatement', 'wat')
def alter_ks_wat_completer(ctxt, cass):
    # would prefer to get rid of the "schema" nomenclature in cql3
    if ctxt.get_binding('partial', '') == '':
        return ['KEYSPACE']
    return ['KEYSPACE', 'SCHEMA']
{code}


was (Author: rnamboodiri):
Here is the code snippet that does the job for in the version 2.1.1. Please let 
me know whether this the job. 
{code:title=cql3handline.py|borderStyle=solid}
syntax_rules += r'''
<alterKeyspaceStatement> ::= "ALTER" wat=( "KEYSPACE" | "SCHEMA" ) 
ks=<alterableKeyspaceName>
                                 "WITH" <property> ( "AND" <property> )*
                           ;
'''
@completer_for('alterKeyspaceStatement', 'wat')
def alter_ks_wat_completer(ctxt, cass):
    # would prefer to get rid of the "schema" nomenclature in cql3
    if ctxt.get_binding('partial', '') == '':
        return ['KEYSPACE']
    return ['KEYSPACE', 'SCHEMA']
{code}

> Improve cqlsh autocomplete for alter keyspace
> ---------------------------------------------
>
>                 Key: CASSANDRA-8021
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-8021
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Philip Thompson
>            Assignee: Rajanarayanan Thottuvaikkatumana
>            Priority: Minor
>              Labels: cqlsh, lhf
>             Fix For: 2.0.11, 2.1.1
>
>
> Cqlsh autocomplete stops giving suggestions for the statement
> {code}ALTER KEYSPACE k WITH REPLICATION { 'class' : 'SimpleStrategy', 
> 'replication_factor' : 1'};{code} after the word "WITH".



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to