Preserve keyword case
See original GitHub issueSome users prefer that the original case of SQL keywords be preserved, for example:
System.out.println(CCJSqlParserUtil.parseStatements("select * from sysdatabases").toString());
Desired behavior:
Optionally (or by some other means) preserve keyword case, for example print:
select * from sysdatabases
System: JSqlParser version 3.1 (latest) Java 8
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
The Preserve Keyword - Code Snippets - Visual Basic Planet
The Preserve keyword indicates that the data stored in the array prior to redimensioning should be transferred to the newly created array. If...
Read more >ReDim statement (VBA) - Microsoft Learn
Keyword used to preserve the data in an existing array when you change the size of the last dimension. varname, Required. Name of...
Read more >Use this extension to preserve case when using ... - TikTok
1.4K Likes, 22 Comments. TikTok video from Visual Studio Code (@vscode): "Use this extension to preserve case when using multiple cursors!
Read more >Keyword Case · Unibeautify
Keyword Case ; Config Key: keyword_case ; Description: Case type for keywords ; Available since version: 0.17.0 (Current: npm ) ; Type: string...
Read more >Use More Case Keywords to Find Articles - Salesforce Help
Use More Case Keywords to Find Articles. When searching articles from a case, by default, only the case title is used in the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
So may we close this one?
Additionally, you have the original SQL. There the case is not attached.
As I said, the deparsers could be changed in a way, to make some case changes on used keywords.
This could be the start of some pretty printing stuff within the deparsers.
I don’t think, the request you filed at javacc will have any influence on this. The grammar of JSqlParser itself uses this tokens and build an object hierarchy from this. The case of object names is preserved, but when you use a toString or a deparser, the keywords do not come from the accepted tokens, but from string constants like “SELECT”.
One solution here would be to write or adapt the deparsers to be able to use upper case or lower case keywords.
You could file a PR.