diff --git a/CHANGELOG.md b/CHANGELOG.md index 0480edff..45d83ec1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +- sqlfmt now supports the `<=>` operator ([#432](https://github.com/tconbeer/sqlfmt/issues/432) - thank you [@kathykwon](https://github.com/kathykwon)!) + ## [0.18.3] - 2023-05-31 - fixes a bug where multiple c-style comments (e.g., `/* comment */`) on a single line would cause sqlfmt diff --git a/src/sqlfmt/rules/core.py b/src/sqlfmt/rules/core.py index a4b8b029..d8cd4c90 100644 --- a/src/sqlfmt/rules/core.py +++ b/src/sqlfmt/rules/core.py @@ -164,6 +164,7 @@ r"@@@?", # center point operator; also text match r"##", # closest point r"<->", # distance operator + r"<=>", # null-safe equals (mysql) r"@>", # contains r"<@", # contained by r"<>", diff --git a/tests/unit_tests/test_rule.py b/tests/unit_tests/test_rule.py index d0de18a8..438db142 100644 --- a/tests/unit_tests/test_rule.py +++ b/tests/unit_tests/test_rule.py @@ -79,6 +79,7 @@ def get_rule(ruleset: List[Rule], rule_name: str) -> Rule: (CORE, "operator", "<>"), (CORE, "operator", "||"), (CORE, "operator", "=>"), + (CORE, "operator", "<=>"), (CORE, "operator", "||/"), (CORE, "operator", "|/"), (CORE, "operator", "#"),