This commit is contained in:
Raymond 2026-08-01 14:10:14 +03:00 committed by GitHub
commit df2ba7d6ee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 13 additions and 0 deletions

View File

@ -268,6 +268,7 @@ JUNK ::= /([ \t\r\f\v]+|(--|[/][/])[^\n\r]*([\n\r]|$)|[/][*].*?[*][/])/ ;
| <schemaChangeStatement> | <schemaChangeStatement>
| <authenticationStatement> | <authenticationStatement>
| <authorizationStatement> | <authorizationStatement>
| <identityStatement>
; ;
<dataChangeStatement> ::= <insertStatement> <dataChangeStatement> ::= <insertStatement>
@ -328,6 +329,10 @@ JUNK ::= /([ \t\r\f\v]+|(--|[/][/])[^\n\r]*([\n\r]|$)|[/][*].*?[*][/])/ ;
| <listPermissionsStatement> | <listPermissionsStatement>
; ;
<identityStatement> ::= <addIdentityStatement>
| <dropIdentityStatement>
;
# timestamp is included here, since it's also a keyword # timestamp is included here, since it's also a keyword
<simpleStorageType> ::= typename=( <identifier> | <stringLiteral> | "timestamp" ) ; <simpleStorageType> ::= typename=( <identifier> | <stringLiteral> | "timestamp" ) ;
@ -1773,6 +1778,14 @@ def username_name_completer(ctxt, cass):
session = cass.session session = cass.session
return map(maybe_escape_name, [row['name'] for row in session.execute("LIST USERS")]) return map(maybe_escape_name, [row['name'] 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') @completer_for('rolename', 'role')
def rolename_completer(ctxt, cass): def rolename_completer(ctxt, cass):