diff --git a/mug-guava/src/main/java/com/google/mu/safesql/SafeSql.java b/mug-guava/src/main/java/com/google/mu/safesql/SafeSql.java index 09415ea461..06bb7cc7ea 100644 --- a/mug-guava/src/main/java/com/google/mu/safesql/SafeSql.java +++ b/mug-guava/src/main/java/com/google/mu/safesql/SafeSql.java @@ -145,6 +145,24 @@ * *
That said, for trivial conditional subqueries such as selecting a column only if a flag is + * enabled, you can use the special conditional subquery operator {@code ->} in the template: + * + *
{@code + * SafeSql sql = SafeSql.of( + * "SELECT {shows_email -> email,} name FROM Users", showsEmail()); + * }+ * + * The text after the {@code ->} operator is the conditional subquery that's only included if + * {@code showEmail()} returns true. The subquery can include arbitrary characters except curly + * braces, so for example you can have multi-line conditional subqueries too. + * + *
That said, for trivial conditional subqueries such as selecting a column only if a flag is - * enabled, you can use the special conditional subquery operator {@code ->} in the template: - * - *
{@code - * SafeSql sql = SafeSql.of( - * "SELECT {shows_email -> email,} name FROM Users", showsEmail()); - * }- * - * The text after the {@code ->} operator is the conditional subquery that's only included if - * {@code showEmail()} returns true. - * *