You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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));
The text was updated successfully, but these errors were encountered:
psychemedia
changed the title
Simple usage - formatting Keywords
Simple usage - formatting Function Keywords
Oct 1, 2018
Same kind of issue happening with me SELECT coalesce(date_format(be.publish_datetime,'%m-%d-%Y'),' ') AS Published_Date, COALESCE(DATE_FORMAT(bh.Awarded_Date,'%m-%d-%Y'),' ') AS Awarded_Date,
Above is the output i got. Ideally i was expecting coalesce to be converted to upper case.
Is there a proper way that i can do this? @andialbrecht
Note: Tried diving into the code but i am beginner in python, hence the code was overwhelming for me.
Hi
I seem to be misunderstanding s/thing about usage. Running:
I get the output:
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?
The text was updated successfully, but these errors were encountered: