Class SqlFormatter
- java.lang.Object
-
- com.github.vertical_blank.sqlformatter.SqlFormatter
-
public class SqlFormatter extends Object
-
-
Constructor Summary
Constructors Constructor Description SqlFormatter()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
format(String query)
static String
format(String query, FormatConfig cfg)
FormatConfig whitespaces in a query to make it easier to read.static String
format(String query, String indent)
static String
format(String query, String indent, List<?> params)
static String
format(String query, String indent, Map<String,?> params)
static String
format(String query, List<?> params)
static String
format(String query, Map<String,?> params)
static AbstractFormatter
of(String name)
static AbstractFormatter
standard()
-
-
-
Method Detail
-
format
public static String format(String query, FormatConfig cfg)
FormatConfig whitespaces in a query to make it easier to read.- Parameters:
query
- sqlcfg
- cfg.indent Characters used for indentation, default is " " (2 spaces) cfg.params Collection of params for placeholder replacement- Returns:
- {String}
-
standard
public static AbstractFormatter standard()
-
of
public static AbstractFormatter of(String name)
-
-