mirror of https://github.com/apache/cassandra
Added autocomplete for ADD and DROP identity statements
This commit is contained in:
parent
a88ff20469
commit
b5ae7b7655
|
|
@ -268,6 +268,7 @@ JUNK ::= /([ \t\r\f\v]+|(--|[/][/])[^\n\r]*([\n\r]|$)|[/][*].*?[*][/])/ ;
|
|||
| <schemaChangeStatement>
|
||||
| <authenticationStatement>
|
||||
| <authorizationStatement>
|
||||
| <identityStatement>
|
||||
;
|
||||
|
||||
<dataChangeStatement> ::= <insertStatement>
|
||||
|
|
@ -316,6 +317,10 @@ JUNK ::= /([ \t\r\f\v]+|(--|[/][/])[^\n\r]*([\n\r]|$)|[/][*].*?[*][/])/ ;
|
|||
| <listPermissionsStatement>
|
||||
;
|
||||
|
||||
<identityStatement> ::= <addIdentityStatement>
|
||||
| <dropIdentityStatement>
|
||||
;
|
||||
|
||||
# timestamp is included here, since it's also a keyword
|
||||
<simpleStorageType> ::= typename=( <identifier> | <stringLiteral> | "timestamp" ) ;
|
||||
|
||||
|
|
@ -1623,6 +1628,14 @@ def username_name_completer(ctxt, cass):
|
|||
session = cass.session
|
||||
return [maybe_quote(list(row.values())[0].replace("'", "''")) for row in session.execute("LIST USERS")]
|
||||
|
||||
syntax_rules += r'''
|
||||
<addIdentityStatement> ::= "ADD" "IDENTITY" ( "IF" "NOT" "EXISTS" )? <stringLiteral>
|
||||
"TO" "ROLE" <rolename>
|
||||
;
|
||||
<dropIdentityStatement> ::= "DROP" "IDENTITY" ( "IF" "NOT" "EXISTS" )? <stringLiteral>
|
||||
;
|
||||
'''
|
||||
|
||||
|
||||
@completer_for('rolename', 'role')
|
||||
def rolename_completer(ctxt, cass):
|
||||
|
|
|
|||
Loading…
Reference in New Issue