Skip to content

Commit

Permalink
Merged for javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
fluentfuture committed Nov 8, 2024
2 parents 199a7fa + 0efb43a commit 7768549
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions mug-guava/src/main/java/com/google/mu/safesql/SafeSql.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,12 @@
* Sometimes you may wish to parameterize by table names, column names etc.
* for which JDBC has no support.
*
* If the identifiers can come from compile-time literals, you can wrap them using
* <p>If the identifiers are compile-time string literals, you can wrap them using
* {@code SafeSql.of(COLUMN_NAME)}, which can then be composed as subqueries.
*
* <p>But what if the identifier string is loaded from a resource file, or is specified by a
* But what if the identifier string is loaded from a resource file, or is specified by a
* request field?
* <br>Passing the string directly as a template parameter will only generate the JDBC
*
* <p>Passing the string directly as a template parameter will only generate the JDBC
* <code>'?'</code> parameter in its place, which won't work (JDBC can't parameterize identifiers);
* {@code SafeSql.of(theString)} will fail to compile because such strings are inherently
* dynamic and untrusted.
Expand All @@ -170,7 +170,9 @@
* <p>In the above example, if {@code getColumns()} returns {@code ["id", "age"]}, the genereated
* SQL will be:
*
* <pre>{@code SELECT `id`, `age` FROM Users}</pre>
* <pre>{@code
* SELECT `id`, `age` FROM Users
* }</pre>
*
* <p>That is, each individual string will be backtick-quoted and then joined by ", ".
*
Expand Down

0 comments on commit 7768549

Please sign in to comment.