Search before asking
What Happened
When using backticks in table aliases and using the alias in the SELECT statement gives an error.
Expected Behaviour
I expect the linting to succeed
Observed Behaviour
The sqlfluff lint failed with the following error:
L: 1 | P: 8 | RF01 | Reference '`nih`.`userID`' refers to table/view not
| found in the FROM clause or found in ancestor statement.
| [references.from]
L: 2 | P: 44 | AL05 | Alias '`nih`' is never used in SELECT statement.
| [aliasing.unused]
How to reproduce
SELECT `nih`.`userID`
FROM `flight_notification_item_history` AS `nih`
Dialect
mysql
Version
sqlfluff, version 2.3.4
Configuration
[sqlfluff]
templater = jinja
sql_file_exts = .sql
large_file_skip_byte_limit = 0
[sqlfluff:rules]
capitalisation_policy = upper
[sqlfluff:rules:references.quoting]
prefer_quoted_identifiers = True
Are you willing to work on and submit a PR to address the issue?
Code of Conduct
Search before asking
What Happened
When using backticks in table aliases and using the alias in the SELECT statement gives an error.
Expected Behaviour
I expect the linting to succeed
Observed Behaviour
The sqlfluff lint failed with the following error:
How to reproduce
Dialect
mysql
Version
sqlfluff, version 2.3.4
Configuration
[sqlfluff]
templater = jinja
sql_file_exts = .sql
large_file_skip_byte_limit = 0
[sqlfluff:rules]
capitalisation_policy = upper
[sqlfluff:rules:references.quoting]
prefer_quoted_identifiers = True
Are you willing to work on and submit a PR to address the issue?
Code of Conduct