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

Simple usage - formatting Function Keywords #435

Open
psychemedia opened this Issue Oct 1, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@psychemedia

psychemedia commented Oct 1, 2018

Hi

I seem to be misunderstanding s/thing about usage. Running:

import sqlparse
sqlparse.format("select * from count(x);", keyword_case='upper')

I get the output:

'SELECT * FROM count(x);'

Terms of the form keyword() do not get uppercased, whereas I'd expect them to (I see them listed as keywords in the code?)?

Is this something to do with the tokeniser getting upset by the brackets? Things seem to work if the brackets are escaped?

import re
x=sqlparse.format(re.escape("select * from max(count(x));"), keyword_case='upper')
re.sub(r'\\(.)', r'\1', x)

#>> SELECT * FROM MAX(COUNT(x));

@psychemedia psychemedia changed the title from Simple usage - formatting Keywords to Simple usage - formatting Function Keywords Oct 1, 2018

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