From b5ae7b76551989470f3f970c3923f717251454f0 Mon Sep 17 00:00:00 2001 From: rwelgosh Date: Thu, 26 Dec 2024 18:41:38 -0500 Subject: [PATCH] Added autocomplete for ADD and DROP identity statements --- pylib/cqlshlib/cql3handling.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pylib/cqlshlib/cql3handling.py b/pylib/cqlshlib/cql3handling.py index 457582f3d3..bbe0a5242e 100644 --- a/pylib/cqlshlib/cql3handling.py +++ b/pylib/cqlshlib/cql3handling.py @@ -268,6 +268,7 @@ JUNK ::= /([ \t\r\f\v]+|(--|[/][/])[^\n\r]*([\n\r]|$)|[/][*].*?[*][/])/ ; | | | + | ; ::= @@ -316,6 +317,10 @@ JUNK ::= /([ \t\r\f\v]+|(--|[/][/])[^\n\r]*([\n\r]|$)|[/][*].*?[*][/])/ ; | ; + ::= + | + ; + # timestamp is included here, since it's also a keyword ::= typename=( | | "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''' + ::= "ADD" "IDENTITY" ( "IF" "NOT" "EXISTS" )? + "TO" "ROLE" + ; + ::= "DROP" "IDENTITY" ( "IF" "NOT" "EXISTS" )? + ; +''' + @completer_for('rolename', 'role') def rolename_completer(ctxt, cass):