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

API - Formatting Bug #4

Open
CrazyTim opened this issue Sep 3, 2014 · 2 comments
Open

API - Formatting Bug #4

CrazyTim opened this issue Sep 3, 2014 · 2 comments

Comments

@CrazyTim
Copy link

CrazyTim commented Sep 3, 2014

REQUEST:

SELECT field FROM rted ORDER BY field1, field2, field3

RESPONSE:

SELECT field
FROM   RTED
ORDER  BY field1,field2,field3 

Table name should be lowercase, and columns in ORDER BY clause need a space between them

@CrazyTim CrazyTim changed the title Formatting querks API - Formatting Bug Sep 3, 2014
@sqlparser
Copy link
Owner

You can send format options to FaaS to control the layout.

Here is the Java code

            String formatSql = sendPost( "http://www.gudusoft.com/format.php",
                    "rqst_db_vendor=oracle&rqst_isf_client=java_client&rqst_input_sql="
                            + URLEncoder.encode( sql, "utf-8" )
                            +"&rqst_formatOptions="+ URLEncoder.encode( fmtOptions, "utf-8" )
                        );

Source code of Java demo:

http://www.gudusoft.com/isf_client_java_demo.zip

API manual:

https://github.com/sqlparser/sql-pretty-printer/wiki/SQL-FaaS-API-manual

@sqlparser
Copy link
Owner

For your questions, case of table name can be set use this option. Space after order by item still need to be improved.

        "tableName":{
          "sqlid":"10219632",
          "fmt105_case_table_name":"upper"
        }

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

2 participants