Java sql formatter. It takes the String / StringBuffer expression on the input and generates nicely formatted SQL string. It can be easily embedded into any editor (Eclipse/NetBeans...) using Autokey or AutoHkey.
Python
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.gitignore
README.md
jsqlformatter_autohkey.py
jsqlformatter_autokey.py
jsqlformatter_autokey3.py

README.md

jsqlformatter

Java SQL formatter. It takes the String / StringBuffer expression as an input and generates nicely formatted SQL string. It can be easily embedded into any IDE (Eclipse/NetBeans...) using Autokey or AutoHkey. It is recommended to define hotkey in Autokey/AutoHKey that triggers jsqlformatter script. Jsqlformatter takes the clipboard content as an input, process it and stores result back to clipboard so that the formatted text can be easy pasted to the editor (Eclipse, Netbeans etc.)

Example:

INPUT:

sb.append(" select ");
sb.append(" home_url, ");
sb.append(" user_first_name ");
sb.append(" from ");
sb.append(User.TABLE);
sb.append(" WHERE ");
sb.append(" url LIKE '" + like + "' ");
sb.append(" and user_id != " + userId);
sb.append(" order by");
sb.append(" NLSSORT(user_first_name,'NLS_SORT=XWEST_EUROPEAN')");

OUTPUT:

    "SELECT " +
            "home_url,  user_first_name  " +
    "FROM " +
            User.TABLE + " " +
    "WHERE " +
            "url LIKE '" +  like + "'  " +
            "AND user_id != " +  userId + " " +
    "ORDER BY " +
            "NLSSORT(user_first_name, " +
            "'NLS_SORT=XWEST_EUROPEAN')";