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

Add query formatter to SQL block #330

Open
lucasfcosta opened this issue Feb 4, 2025 · 0 comments
Open

Add query formatter to SQL block #330

lucasfcosta opened this issue Feb 4, 2025 · 0 comments

Comments

@lucasfcosta
Copy link
Member

We should have an easy way for people to automatically format their SQL blocks.

Ideally the formatter should appear on the right-hand side of the SQL block when the code part is not collapsed.

Image

Clicking the formatter button should format the query.

I'm not too worried about which formatter to use, as long as it's a popular one and not a niche one whose standards nobody agrees with.

When it comes to formatting, all you need to do is get the content of the block (get the source attribute), pass it through the formatter, set the result as the new source of the block (remember to use the right Yjs type - I think we already do this elsewhere when accepting AI suggestions for example, so have a look there)

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

No branches or pull requests

1 participant