Packages

class QueryInterpolator extends AnyRef

Source
QueryInterpolator.scala
Linear Supertypes
AnyRef, Any
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. QueryInterpolator
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new QueryInterpolator(context: StringContext)

Value Members

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

    String interpolation using the "b" prefix to build SQL statements.

    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.