mirror of https://github.com/apache/cassandra
(dumb )cqlsh completion for PRIMARY KEY in CREATE
Patch by eevans git-svn-id: https://svn.apache.org/repos/asf/cassandra/trunk@1087039 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3ff6b2919b
commit
2efa95d8e8
|
|
@ -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")
|
||||
|
|
|
|||
|
|
@ -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
|
||||
""")
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue