Skip to content

Conversation

@Sea-n
Copy link

@Sea-n Sea-n commented Jan 21, 2026

Summary

  • Treat -> and ->> as SQL operators in the lexer.
  • Prevent formatter from inserting spaces around JSON path operators.
  • Add formatter test for JSON path access.

For example: SELECT details->'$."first_name"' FROM users;

Expected:

SELECT
    details->'$."first_name"'
FROM
    users;

Actual:

SELECT
    details - > '$."first_name"'
FROM
    users;

Caused SQL syntax error.

Tests

./vendor/bin/phpunit passed

I didn’t run ./vendor/bin/phpcbf as suggested in CONTRIBUTING.md because it currently changes about 60 files and produces roughly 150 lines of diff. If you’re okay with it, I’d love to handle that in a separate PR.

References

- Treat `->` and `->>` as SQL operators in the lexer.
- Prevent formatter from inserting spaces around JSON path operators.
- Add formatter test for JSON path access.

For example:

    SELECT
        details->'$."first_name"'
    FROM
        users;
@Sea-n
Copy link
Author

Sea-n commented Jan 21, 2026

CC @MauricioFauth and @williamdes,
if you have a chance to review, I'd really appreciate it. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant