Skip to content

Commit 7b3f66e

Browse files
committed
fix: revert original identifier and add test cases
1 parent b41f231 commit 7b3f66e

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

grammar.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3697,6 +3697,7 @@ module.exports = grammar({
36973697
$._double_quote_string,
36983698
$._backtick_quoted_string,
36993699
$._tsql_parameter,
3700+
seq("`", $._identifier, "`"),
37003701
),
37013702
_tsql_parameter: $ => seq('@', $._identifier),
37023703
// support nordic chars and umlaue

test/corpus/select.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3192,3 +3192,24 @@ SELECT * FROM "table_name";
31923192
(relation
31933193
(object_reference
31943194
name: (identifier))))))
3195+
3196+
================================================================================
3197+
Select from table with identifiers containing hyphens, dots, or other special characters within backticks
3198+
================================================================================
3199+
3200+
SELECT * FROM `complex-database.schema_name.table_name`;
3201+
3202+
--------------------------------------------------------------------------------
3203+
3204+
(program
3205+
(statement
3206+
(select
3207+
(keyword_select)
3208+
(select_expression
3209+
(term
3210+
value: (all_fields))))
3211+
(from
3212+
(keyword_from)
3213+
(relation
3214+
(object_reference
3215+
name: (identifier))))))

0 commit comments

Comments
 (0)