schemachange icon indicating copy to clipboard operation
schemachange copied to clipboard

SQL Syntax error when Snowflake role name includes special characters such as hyphens

Open jonathancisneros opened this issue 1 year ago • 1 comments

The USE ROLE and the other USE query template strings here: https://github.com/Snowflake-Labs/schemachange/blob/master/schemachange/cli.py#L213

are not using quoted values for the placeholder values, if there are special characters in the name of those values, the execution of the reset_session function fails with SQL compilation or syntax error.

please update the USE xxx template strings to support special characters by using quoted values like this: _q_set_sess_role = 'USE ROLE "{role}";'

jonathancisneros avatar Jan 02 '24 19:01 jonathancisneros