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

Formatted SQL output #41

Open
GoogleCodeExporter opened this issue Mar 25, 2015 · 2 comments
Open

Formatted SQL output #41

GoogleCodeExporter opened this issue Mar 25, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

It would be nice to have the SQL Output formatted for better readability.
In Hibernate is e.g. a special parameter : formatted_sql

The output in Logger:
Hibernate: 
    select
        emailsv0_.bean_id as bean1_147_,
        emailsv0_.bean_module as bean2_147_,
        emailsv0_.email_address as email3_147_,
        emailsv0_.email_address_caps as email4_147_,
        emailsv0_.id as id147_ 
    from
        sugarcrm.emails_v emailsv0_ 
    where
        emailsv0_.email_address_caps='SDASDSADFDSFSDSD' 
        and emailsv0_.bean_module='Contacts'

versus

JDBC Logger: 
 com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76)
3. select emailsv0_.bean_id as bean1_147_, emailsv0_.bean_module as bean2_147_, 
emailsv0_.email_address 
as email3_147_, emailsv0_.email_address_caps as email4_147_, emailsv0_.id as 
id147_ from sugarcrm.emails_v 
emailsv0_ where emailsv0_.email_address_caps='SDASDSADFDSFSDSD' and 
emailsv0_.bean_module='Contacts' 

Original issue reported on code.google.com by [email protected] on 5 Oct 2011 at 4:49

@GoogleCodeExporter
Copy link
Author

Yeah, that is really nice.  I really am trying to avoid parsing the SQL though 
as that would add a lot of complexity and could impact performance.  On the 
other hand, it could open up a lot of power and pave the way for a lot of cool 
new features.  But right now I have no time to embark on something like now.  
But it is still something to keep on the wish list for future possibilities.

Original comment by [email protected] on 22 Mar 2012 at 1:29

  • Added labels: Priority-Low, Type-Enhancement
  • Removed labels: Priority-Medium, Type-Defect

@GoogleCodeExporter
Copy link
Author

https://github.com/hibernate/hibernate-orm/blob/b943525c80b411c9fa1f66b44f8a5b14
f928bf34/hibernate-core/src/main/java/org/hibernate/engine/jdbc/internal/BasicFo
rmatterImpl.java

Original comment by [email protected] on 6 Jan 2015 at 12:59

  • Added labels: ****
  • Removed labels: ****

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

No branches or pull requests

1 participant