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

[5.x] Enhance query preview when using the pgsql driver #1486

Merged
merged 4 commits into from
Jun 17, 2024

Conversation

morloderex
Copy link
Contributor

@morloderex morloderex commented Jun 14, 2024

This is an attempt to fix the rendering issue that was reported in #1435

It does it by simply using the laravel framework build-in sql formatting logic if the laravel version is above 10.x. And appending the driver name to telescope content so that the sql-formatting javascript formatting library can format it in the correct dialect, while still falling back to use default of sql if it is not present.

I have also updated the javascript highlighter to it's own component in order to detect the correct dialect for psgql to take place.

However there is a breaking change with doing it in this way due to the framework's build-in sql formatting logic doesn't support named bindings. But given that framework's query builder itself only supports ? parameters anyway i don't really see that as a huge issue.

@taylorotwell taylorotwell merged commit 1394592 into laravel:5.x Jun 17, 2024
12 checks passed
@driesvints
Copy link
Member

Thanks for this PR @morloderex!

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.

3 participants