package anorm

Anorm API

Use the SQL method to start an SQL query

import anorm._

SQL("Select 1")
Linear Supertypes
  1. Alphabetic
  2. By Inheritance
  1. anorm
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
  1. Public
  2. All

Type Members

  1. final case class AnormException(message: String) extends Exception with NoStackTrace with Product with Serializable

    Anorm runtime exception

  2. sealed trait BatchSql extends AnyRef

    SQL batch

  3. trait Column[A] extends (Any, MetaDataItem) ⇒ Either[SqlRequestError, A]

    Column mapping

    Column mapping

    @implicitNotFound( ... )
  4. trait ColumnAliaser extends Function[(Int, ColumnName), Option[String]]

    Allows to define or overwrite the alias for a column.

  5. case class ColumnName(qualified: String, alias: Option[String]) extends Product with Serializable


    the qualified column name


    the column alias

  6. case class ColumnNotFound(column: String, available: Seq[String]) extends SqlRequestError with Product with Serializable

    Error raised when the specified column cannot be found in results.

    Error raised when the specified column cannot be found in results.


    the name of the not found column


    the names of the available columns

  7. sealed trait Cursor extends AnyRef

    Result cursor

  8. final class DefaultParameterValue[A] extends ParameterValue with Wrapper[A]
  9. case class Error(msg: SqlRequestError) extends SqlResult[Nothing] with Product with Serializable

    Erroneous result (failure while parsing).

  10. sealed trait JavaTimeColumn extends AnyRef
  11. sealed trait JavaTimeParameterMetaData extends AnyRef
  12. sealed trait JavaTimeToStatement extends AnyRef
  13. sealed trait JodaColumn extends AnyRef
  14. sealed trait JodaToStatement extends AnyRef
  15. case class MetaDataItem(column: ColumnName, nullable: Boolean, clazz: String) extends Product with Serializable


    the name of the column


    true if the column is nullable


    the class of the JDBC column value

  16. final case class NamedParameter(name: String, value: ParameterValue) extends Product with Serializable

    Applied named parameter.

  17. trait NotNullGuard extends AnyRef

    Marker trait to indicate that even if a type T accept null as value, it must be refused in some Anorm context.

  18. case class Object(value: Any) extends Product with Serializable

    Untyped value wrapper.

    Untyped value wrapper.

    SQL("UPDATE t SET val = {o}").on('o -> anorm.Object(val))
  19. sealed trait PGJson extends AnyRef
  20. trait ParameterMetaData[T] extends AnyRef

    Parameter meta data for type T

    Parameter meta data for type T

    @implicitNotFound( ... )
  21. sealed trait ParameterValue extends Show

    Prepared parameter value.

    Prepared parameter value.

    @implicitNotFound( ... )
  22. sealed trait ResultSetParser[+A] extends (Option[Cursor]) ⇒ SqlResult[A]

    Parses result from the cursor.

  23. trait Row extends AnyRef
  24. trait RowParser[+A] extends (Row) ⇒ SqlResult[A]
  25. sealed trait ScalarRowParser[+A] extends RowParser[A]

    Parser for scalar row (row of one single column).

  26. sealed trait SeqParameter[A] extends AnyRef

    Wrapper to use a value sequence as SQL parameter, with custom formatting.

    Wrapper to use a value sequence as SQL parameter, with custom formatting.

    SQL("SELECT * FROM t WHERE %s").
      on(SeqParameter(Seq("a", "b"), " OR ", Some("cat = ")))
    // Will execute as:
    // SELECT * FROM t WHERE cat = 'a' OR cat = 'b'
  27. trait Show extends AnyRef

    Typeclass for string representation

  28. case class SimpleSql[T](sql: SqlQuery, params: Map[String, ParameterValue], defaultParser: RowParser[T], resultSetOnFirstRow: Boolean = false) extends Sql with Product with Serializable

    Simple/plain SQL.

  29. case class SqlMappingError(reason: String) extends SqlRequestError with Product with Serializable
  30. sealed trait SqlQuery extends AnyRef

    Initial SQL query, without parameter values.

  31. final case class SqlQueryResult(resultSet: ManagedResource[ResultSet], resultSetOnFirstRow: Boolean = false) extends WithResult with Product with Serializable

    A result from execution of an SQL query, row data and context (e.g.

    A result from execution of an SQL query, row data and context (e.g. statement warnings).


    Result set from executed query

  32. sealed trait SqlRequestError extends AnyRef

    Error from processing SQL

  33. sealed trait SqlResult[+A] extends AnyRef

    Parsed SQL result.

  34. implicit final class SqlStringInterpolation extends AnyVal

    Creates an SQL query using String Interpolation feature.

    Creates an SQL query using String Interpolation feature. It is a 1-step alternative for SQL("...").on(...) functions.

      UPDATE computer SET name = \${},
      introduced = \${computer.introduced},
      discontinued = \${computer.discontinued},
      company_id = \${computer.companyId}
      WHERE id = \$id
  35. final class StringShow extends Show
  36. type StringWrapper2 = AnyRef { def stringValue: String }

    Structural type for oracle.sql.ROWID wrapper.

  37. case class Success[A](a: A) extends SqlResult[A] with Product with Serializable

    Successfully parsed result.

  38. type TimestampWrapper1 = AnyRef { def getTimestamp: java.sql.Timestamp }

    Structural type for timestamp wrapper.

  39. type TimestampWrapper2 = AnyRef { def timestampValue: java.sql.Timestamp }

    Structural type for oracle.sql.TIMESTAMP wrapper.

  40. trait ToParameterList[A] extends (A) ⇒ List[NamedParameter]

    Convert to a list of NamedParameter

    Convert to a list of NamedParameter

    @implicitNotFound( ... )
  41. sealed trait ToParameterValue[A] extends (A) ⇒ ParameterValue
    @implicitNotFound( ... )
  42. trait ToSql[A] extends AnyRef

    Set value as prepared SQL statement fragment.

    Set value as prepared SQL statement fragment.

    @implicitNotFound( ... )
  43. trait ToStatement[A] extends ToStatementBase[A]

    Sets value as statement parameter.

    Sets value as statement parameter.

    @implicitNotFound( ... )
  44. sealed trait ToStatementPriority0 extends AnyRef
  45. sealed trait ToStatementPriority1 extends ToStatementPriority0
  46. final case class TupleFlattener[F](f: F) extends Product with Serializable
  47. sealed trait TupleFlattenerPriority1 extends AnyRef

    Conversion from 2-column tuple-like to scala.Tuple2, with resolution priority 1.

  48. sealed trait TupleFlattenerPriority10 extends TupleFlattenerPriority9

    Conversion from 11-column tuple-like to scala.Tuple11, with resolution priority 10.

  49. sealed trait TupleFlattenerPriority11 extends TupleFlattenerPriority10

    Conversion from 12-column tuple-like to scala.Tuple12, with resolution priority 11.

  50. sealed trait TupleFlattenerPriority12 extends TupleFlattenerPriority11

    Conversion from 13-column tuple-like to scala.Tuple13, with resolution priority 12.

  51. sealed trait TupleFlattenerPriority13 extends TupleFlattenerPriority12

    Conversion from 14-column tuple-like to scala.Tuple14, with resolution priority 13.

  52. sealed trait TupleFlattenerPriority14 extends TupleFlattenerPriority13

    Conversion from 15-column tuple-like to scala.Tuple15, with resolution priority 14.

  53. sealed trait TupleFlattenerPriority15 extends TupleFlattenerPriority14

    Conversion from 16-column tuple-like to scala.Tuple16, with resolution priority 15.

  54. sealed trait TupleFlattenerPriority16 extends TupleFlattenerPriority15

    Conversion from 17-column tuple-like to scala.Tuple17, with resolution priority 16.

  55. sealed trait TupleFlattenerPriority17 extends TupleFlattenerPriority16

    Conversion from 18-column tuple-like to scala.Tuple18, with resolution priority 17.

  56. sealed trait TupleFlattenerPriority18 extends TupleFlattenerPriority17

    Conversion from 19-column tuple-like to scala.Tuple19, with resolution priority 18.

  57. sealed trait TupleFlattenerPriority19 extends TupleFlattenerPriority18

    Conversion from 20-column tuple-like to scala.Tuple20, with resolution priority 19.

  58. sealed trait TupleFlattenerPriority2 extends TupleFlattenerPriority1

    Conversion from 3-column tuple-like to scala.Tuple3, with resolution priority 2.

  59. sealed trait TupleFlattenerPriority20 extends TupleFlattenerPriority19

    Conversion from 21-column tuple-like to scala.Tuple21, with resolution priority 20.

  60. sealed trait TupleFlattenerPriority21 extends TupleFlattenerPriority20

    Conversion from 22-column tuple-like to scala.Tuple22, with resolution priority 21.

  61. sealed trait TupleFlattenerPriority3 extends TupleFlattenerPriority2

    Conversion from 4-column tuple-like to scala.Tuple4, with resolution priority 3.

  62. sealed trait TupleFlattenerPriority4 extends TupleFlattenerPriority3

    Conversion from 5-column tuple-like to scala.Tuple5, with resolution priority 4.

  63. sealed trait TupleFlattenerPriority5 extends TupleFlattenerPriority4

    Conversion from 6-column tuple-like to scala.Tuple6, with resolution priority 5.

  64. sealed trait TupleFlattenerPriority6 extends TupleFlattenerPriority5

    Conversion from 7-column tuple-like to scala.Tuple7, with resolution priority 6.

  65. sealed trait TupleFlattenerPriority7 extends TupleFlattenerPriority6

    Conversion from 8-column tuple-like to scala.Tuple8, with resolution priority 7.

  66. sealed trait TupleFlattenerPriority8 extends TupleFlattenerPriority7

    Conversion from 9-column tuple-like to scala.Tuple9, with resolution priority 8.

  67. sealed trait TupleFlattenerPriority9 extends TupleFlattenerPriority8

    Conversion from 10-column tuple-like to scala.Tuple10, with resolution priority 9.

  68. case class TypeDoesNotMatch(reason: String) extends SqlRequestError with Product with Serializable
  69. case class UnexpectedNullableFound(reason: String) extends SqlRequestError with Product with Serializable
  70. final case class ~[+A, +B](_1: A, _2: B) extends Product with Serializable

    Columns tuple-like

    Columns tuple-like

  71. sealed trait DeprecatedSqlParser extends AnyRef

    (Since version 2.5.4) Do not use these combinators

Value Members

  1. def SQL(stmt: String): SqlQuery

    Creates an SQL query with given statement.

    Creates an SQL query with given statement.


    SQL statement

    val query = SQL("SELECT * FROM Country")
  2. implicit def sqlToSimple(sql: SqlQuery): SimpleSql[Row]
  3. object AkkaStream

    Anorm companion for the

  4. object BatchSql

    SQL batch companion

  5. object Column extends JodaColumn with JavaTimeColumn

    Column companion, providing default conversions.

  6. object ColumnAliaser
  7. object ColumnNotFound extends Serializable
  8. object Cursor

    Cursor companion

  9. object Iteratees

    Anorm companion for the

  10. object JodaParameterMetaData

    Meta data for Joda parameters

  11. object Macro

  12. object NamedParameter extends Serializable

    Companion object for applied named parameter.

  13. object ParameterMetaData extends JavaTimeParameterMetaData

    ParameterMetaData companion, providing defaults based on SQL92.

  14. object ParameterValue

    Value factory for parameter.

    Value factory for parameter.

    val param = ParameterValue("str", null, setter)
  15. object ResultSetResource extends Resource[ResultSet]
  16. object Row

    Companion object for row.

  17. object RowParser
  18. object SeqParameter

    SeqParameter factory

  19. object Show
  20. object SimpleSql extends Serializable
  21. object Sql
  22. object SqlParser extends FunctionAdapter with DeprecatedSqlParser
  23. object SqlQuery
  24. object SqlRequestError
  25. object SqlStatementParser extends JavaTokenParsers

    Parser for SQL statement.

  26. object StatementResource extends Resource[PreparedStatement]
  27. object StringWrapper2
  28. object TimestampWrapper1
  29. object TimestampWrapper2
  30. object ToParameterList

    Companion/factory for ToParameterList.

  31. object ToParameterValue
  32. object ToSql

    Provided ToSql implementations.

  33. object ToStatement extends ToStatementConversions
  34. object TokenGroup extends AbstractFunction2[List[StatementToken], Option[String], TokenGroup] with Serializable
  35. object TupleFlattener extends TupleFlattenerPriority21 with Serializable

    Conversions to flatten columns to tuple.

  36. object features

    Activable features

Inherited from AnyRef

Inherited from Any