Author: eevans
Date: Wed Mar 30 19:02:37 2011
New Revision: 1087039

URL: http://svn.apache.org/viewvc?rev=1087039&view=rev
Log:
(dumb )cqlsh completion for PRIMARY KEY in CREATE

Patch by eevans

Modified:
    cassandra/trunk/drivers/py/cqlsh
    cassandra/trunk/test/system/test_cql.py

Modified: cassandra/trunk/drivers/py/cqlsh
URL: 
http://svn.apache.org/viewvc/cassandra/trunk/drivers/py/cqlsh?rev=1087039&r1=1087038&r2=1087039&view=diff
==============================================================================
--- cassandra/trunk/drivers/py/cqlsh (original)
+++ cassandra/trunk/drivers/py/cqlsh Wed Mar 30 19:02:37 2011
@@ -129,6 +129,7 @@ class Shell(cmd.Cmd):
         
         if words[1].upper() == 'COLUMNFAMILY':
             types = startswith(CQLTYPES, text)
+            keywords = startswith(('KEY', 'PRIMARY'), text.upper())
             props = startswith(("comparator",
                                 "comment",
                                 "row_cache_size",
@@ -144,7 +145,7 @@ class Shell(cmd.Cmd):
                                 "memtable_throughput_in_mb",
                                 "memtable_operations_in_millions",
                                 "replicate_on_write"), text)
-            return startswith(common, text.upper()) + types + props
+            return startswith(common, text.upper()) + types + keywords + props
             
         if words[1].upper() == 'KEYSPACE':
             props = ("replication_factor", "strategy_options", 
"strategy_class")

Modified: cassandra/trunk/test/system/test_cql.py
URL: 
http://svn.apache.org/viewvc/cassandra/trunk/test/system/test_cql.py?rev=1087039&r1=1087038&r2=1087039&view=diff
==============================================================================
--- cassandra/trunk/test/system/test_cql.py (original)
+++ cassandra/trunk/test/system/test_cql.py Wed Mar 30 19:02:37 2011
@@ -81,13 +81,13 @@ def load_sample(dbconn):
 
     dbconn.execute("""
     BEGIN BATCH USING CONSISTENCY ONE
-     UPDATE StandardLongA SET 1='1', 2='2', 3='3', 4='4' WHERE KEY='aa';
-     UPDATE StandardLongA SET 5='5', 6='6', 7='8', 9='9' WHERE KEY='ab';
-     UPDATE StandardLongA SET 9='9', 8='8', 7='7', 6='6' WHERE KEY='ac';
-     UPDATE StandardLongA SET 5='5', 4='4', 3='3', 2='2' WHERE KEY='ad';
-     UPDATE StandardLongA SET 1='1', 2='2', 3='3', 4='4' WHERE KEY='ae';
-     UPDATE StandardLongA SET 1='1', 2='2', 3='3', 4='4' WHERE KEY='af';
-     UPDATE StandardLongA SET 5='5', 6='6', 7='8', 9='9' WHERE KEY='ag';
+     UPDATE StandardLongA SET 1='1', 2='2', 3='3', 4='4' WHERE KEY='aa'
+     UPDATE StandardLongA SET 5='5', 6='6', 7='8', 9='9' WHERE KEY='ab'
+     UPDATE StandardLongA SET 9='9', 8='8', 7='7', 6='6' WHERE KEY='ac'
+     UPDATE StandardLongA SET 5='5', 4='4', 3='3', 2='2' WHERE KEY='ad'
+     UPDATE StandardLongA SET 1='1', 2='2', 3='3', 4='4' WHERE KEY='ae'
+     UPDATE StandardLongA SET 1='1', 2='2', 3='3', 4='4' WHERE KEY='af'
+     UPDATE StandardLongA SET 5='5', 6='6', 7='8', 9='9' WHERE KEY='ag'
     APPLY BATCH
     """)
     


Reply via email to