Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: parse postgres trigram operators #1186

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
test: add SQL test cases for PostgreSQL trigram operators
  • Loading branch information
gvozdvmozgu committed Jan 26, 2025
commit f49f6795bb9a8cf9575c1196f6cd0f61a437bd82
10 changes: 10 additions & 0 deletions crates/lib-dialects/test/fixtures/dialects/postgres/pgtrgm.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
SELECT text % text;
SELECT text <% text;
SELECT text %> text;
SELECT text <<% text;
SELECT text %>> text;
SELECT text <-> text;
SELECT text <<-> text;
SELECT text <->> text;
SELECT text <<<-> text;
SELECT text <->>> text;
121 changes: 121 additions & 0 deletions crates/lib-dialects/test/fixtures/dialects/postgres/pgtrgm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
file:
- statement:
- select_statement:
- select_clause:
- keyword: SELECT
- select_clause_element:
- expression:
- column_reference:
- naked_identifier: text
- binary_operator: '%'
- column_reference:
- naked_identifier: text
- statement_terminator: ;
- statement:
- select_statement:
- select_clause:
- keyword: SELECT
- select_clause_element:
- expression:
- column_reference:
- naked_identifier: text
- comparison_operator: <%
- column_reference:
- naked_identifier: text
- statement_terminator: ;
- statement:
- select_statement:
- select_clause:
- keyword: SELECT
- select_clause_element:
- expression:
- column_reference:
- naked_identifier: text
- comparison_operator: '%>'
- column_reference:
- naked_identifier: text
- statement_terminator: ;
- statement:
- select_statement:
- select_clause:
- keyword: SELECT
- select_clause_element:
- expression:
- column_reference:
- naked_identifier: text
- comparison_operator: <<%
- column_reference:
- naked_identifier: text
- statement_terminator: ;
- statement:
- select_statement:
- select_clause:
- keyword: SELECT
- select_clause_element:
- expression:
- column_reference:
- naked_identifier: text
- comparison_operator: '%>>'
- column_reference:
- naked_identifier: text
- statement_terminator: ;
- statement:
- select_statement:
- select_clause:
- keyword: SELECT
- select_clause_element:
- expression:
- column_reference:
- naked_identifier: text
- comparison_operator: <->
- column_reference:
- naked_identifier: text
- statement_terminator: ;
- statement:
- select_statement:
- select_clause:
- keyword: SELECT
- select_clause_element:
- expression:
- column_reference:
- naked_identifier: text
- comparison_operator: <<->
- column_reference:
- naked_identifier: text
- statement_terminator: ;
- statement:
- select_statement:
- select_clause:
- keyword: SELECT
- select_clause_element:
- expression:
- column_reference:
- naked_identifier: text
- comparison_operator: <->>
- column_reference:
- naked_identifier: text
- statement_terminator: ;
- statement:
- select_statement:
- select_clause:
- keyword: SELECT
- select_clause_element:
- expression:
- column_reference:
- naked_identifier: text
- comparison_operator: <<<->
- column_reference:
- naked_identifier: text
- statement_terminator: ;
- statement:
- select_statement:
- select_clause:
- keyword: SELECT
- select_clause_element:
- expression:
- column_reference:
- naked_identifier: text
- comparison_operator: <->>>
- column_reference:
- naked_identifier: text
- statement_terminator: ;
Loading