QueryInterpolator

slick.util.QueryInterpolator
See theQueryInterpolator companion object
class QueryInterpolator(context: StringContext)

Attributes

Companion:
object
Source:
QueryInterpolator.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Concise view

Value members

Concrete methods

def b(args: Any*)(implicit ic: InterpolationContext): Unit

String interpolation using the "b" prefix to build SQL statements. In general, the generated string is passed to "sqlBuilder.+=". When preceded by '', the following characters have special meaning:

String interpolation using the "b" prefix to build SQL statements. In general, the generated string is passed to "sqlBuilder.+=". When preceded by '', the following characters have special meaning:

  • '(': if(!skipParens) sqlBuilder += '('

  • ')': if(!skipParens) sqlBuilder += ')'

  • '[': Add a '(' plus newline and increase indentation

  • '[': Decrease indentation and add a newline plus ')'

  • '{': Like '[' but only if(!skipParens)

  • '}': Like ']' but only if(!skipParens)

  • 'n': Add a newline plus indentation

If 'slick.sqlIndent' is not set in application.conf, no newlines are inserted and indentation is replaced by a single space character.

Variables inside the string can be prefixed by another symbol before the standard '$' escape character to modify their meaning:

  • '`' (before a String variable s): sqlBuilder += quoteIdentifier(s)

  • '`' (before a Symbol variable s): sqlBuilder += symbolName(s)

  • '!' (before a Node variable n): expr(n, true)

  • no prefix (before a Node variable n): expr(n)

  • no prefix (before a String variable s): sqlBuilder += s

  • no prefix (before an AnyVal variable v): sqlBuilder += String.valueOf(v)

The identifiers sqlBuilder, skipParens, expr, quoteIdentifier and symbolName are resolved dynamically at the call site.

Attributes

Source:
QueryInterpolator.scala