Skip to content

Commit 5242a18

Browse files
committed
added some doc to CCJSqlParserUtil
1 parent 3cdea6b commit 5242a18

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/main/java/net/sf/jsqlparser/parser/CCJSqlParserUtil.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,20 @@ public static Statement parse(String sql) throws JSQLParserException {
4040
return parse(sql, null);
4141
}
4242

43+
/**
44+
* Parses an sql statement while allowing via consumer to configure the used parser before.
45+
*
46+
* For instance to activate SQLServer bracket quotation on could use:
47+
*
48+
* {@code
49+
* CCJSqlParserUtil.parse("select * from [mytable]", parser -> parser.withSquareBracketQuotation(true));
50+
* }
51+
*
52+
* @param sql
53+
* @param consumer
54+
* @return
55+
* @throws JSQLParserException
56+
*/
4357
public static Statement parse(String sql, Consumer<CCJSqlParser> consumer) throws JSQLParserException {
4458
CCJSqlParser parser = new CCJSqlParser(new StringProvider(sql));
4559
if (consumer != null) {

0 commit comments

Comments
 (0)