From aafb3bf7f700a3a100a1c50e3c6e87514a1bdc09 Mon Sep 17 00:00:00 2001 From: Taishi Naka Date: Mon, 31 Mar 2025 16:10:58 +0900 Subject: [PATCH 1/2] change(tree-sitter module): remove opt_select_limit --- .../postgresql-cst-parser/src/tree_sitter/convert.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/crates/postgresql-cst-parser/src/tree_sitter/convert.rs b/crates/postgresql-cst-parser/src/tree_sitter/convert.rs index c6b08ae..0898156 100644 --- a/crates/postgresql-cst-parser/src/tree_sitter/convert.rs +++ b/crates/postgresql-cst-parser/src/tree_sitter/convert.rs @@ -191,6 +191,7 @@ fn walk_and_build( | SyntaxKind::select_no_parens | SyntaxKind::simple_select | SyntaxKind::select_clause + | SyntaxKind::opt_select_limit | SyntaxKind::opt_target_list => { // [Node: Removal] // @@ -279,6 +280,16 @@ FROM let (new_root, _) = get_ts_tree_and_range_map(input, &root); assert_not_exists(&new_root, SyntaxKind::opt_target_list); } + + #[test] + fn no_opt_select_limit() { + let input = "select a from t for update limit 5 offset 5;"; + let root = cst::parse(input).unwrap(); + assert_exists(&root, SyntaxKind::opt_select_limit); + + let (new_root, _) = get_ts_tree_and_range_map(input, &root); + assert_not_exists(&new_root, SyntaxKind::opt_select_limit); + } } mod flatten { From 77ac4663026e1d6a953ce8142c8e6170e0b396c1 Mon Sep 17 00:00:00 2001 From: Taishi Naka Date: Mon, 31 Mar 2025 16:31:22 +0900 Subject: [PATCH 2/2] change(tree-sitter module): remove select_limit --- .../postgresql-cst-parser/src/tree_sitter/convert.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/crates/postgresql-cst-parser/src/tree_sitter/convert.rs b/crates/postgresql-cst-parser/src/tree_sitter/convert.rs index 0898156..1c4c131 100644 --- a/crates/postgresql-cst-parser/src/tree_sitter/convert.rs +++ b/crates/postgresql-cst-parser/src/tree_sitter/convert.rs @@ -192,6 +192,7 @@ fn walk_and_build( | SyntaxKind::simple_select | SyntaxKind::select_clause | SyntaxKind::opt_select_limit + | SyntaxKind::select_limit | SyntaxKind::opt_target_list => { // [Node: Removal] // @@ -290,6 +291,16 @@ FROM let (new_root, _) = get_ts_tree_and_range_map(input, &root); assert_not_exists(&new_root, SyntaxKind::opt_select_limit); } + + #[test] + fn no_select_limit() { + let input = "select a from t limit 5 offset 5;"; + let root = cst::parse(input).unwrap(); + assert_exists(&root, SyntaxKind::select_limit); + + let (new_root, _) = get_ts_tree_and_range_map(input, &root); + assert_not_exists(&new_root, SyntaxKind::select_limit); + } } mod flatten {