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

Format the sql query #3530

Open
amarjeetanandsingh opened this issue Sep 8, 2019 · 2 comments

Comments

@amarjeetanandsingh
Copy link

commented Sep 8, 2019

Hi
I tried to format the sql query in the Query tab, but cannot see any option.

Anybody can help??

@peierlong

This comment has been minimized.

Copy link

commented Sep 11, 2019

Click Menu > Bundle > Bundle Editor > Input Filed > Format > Format Sql

Like this

image

by: https://github.com/andialbrecht/sqlparse

@peierlong

This comment has been minimized.

Copy link

commented Sep 11, 2019

#![your python path]
#coding=utf-8
import sqlparse
import sys
sql = sys.stdin.read()
statements = sqlparse.split(sql)
first = statements[0]
print(sqlparse.format(first, reindent=True, keyword_case='upper'), end = '')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.