anorm

Sql

sealed trait Sql extends AnyRef

Source
Anorm.scala
Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Sql
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def getFilledStatement(connection: Connection, getGeneratedKeys: Boolean = false): PreparedStatement

Concrete Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def apply()(implicit connection: Connection): Stream[Row]

    Executes this SQL statement as query, returns result as Row stream.

  7. def as[T](parser: ResultSetParser[T])(implicit connection: Connection): T

    Executes this statement as query and convert result as T, using parser.

  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  11. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  12. def execute()(implicit connection: Connection): Boolean

    Executes this SQL statement.

    Executes this SQL statement.

    returns

    true if resultset was returned from execution (statement is query), or false if it executed update

  13. def execute1(getGeneratedKeys: Boolean = false)(implicit connection: Connection): (PreparedStatement, Int)

  14. def executeInsert[A](generatedKeysParser: ResultSetParser[A] = SqlParser.scalar[Long].singleOpt)(implicit connection: Connection): A

    Executes this SQL as an insert statement.

    Executes this SQL as an insert statement.

    generatedKeysParser

    Parser for generated key (default: scalar long)

    returns

    Parsed generated keys

    import anorm.SqlParser.scalar
    
    val keys1 = SQL("INSERT INTO Test(x) VALUES ({x})").
      on("x" -> "y").executeInsert()
    
    val keys2 = SQL("INSERT INTO Test(x) VALUES ({x})").
      on("x" -> "y").executeInsert(scalar[String].singleOpt)
    // ... generated string key
  15. def executeQuery()(implicit connection: Connection): SqlQueryResult

    Executes this SQL query, and returns its result.

    Executes this SQL query, and returns its result.

    implicit val conn: Connection = openConnection
    val res: SqlQueryResult =
      SQL("SELECT text_col FROM table WHERE id = {code}").
      on("code" -> code).executeQuery()
    // Check execution context; e.g. res.statementWarning
    val str = res as scalar[String].single // going with row parsing
  16. def executeUpdate()(implicit connection: Connection): Int

    Executes this SQL as an update statement.

    Executes this SQL as an update statement.

    returns

    Count of updated row(s)

    Annotations
    @throws( "If statement is query not update" )
  17. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  19. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  20. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  21. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  22. final def notify(): Unit

    Definition Classes
    AnyRef
  23. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  24. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  25. def toString(): String

    Definition Classes
    AnyRef → Any
  26. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def filledStatement(implicit connection: Connection): PreparedStatement

    Annotations
    @deprecated
    Deprecated

    (Since version 2.3.0) Use getFilledStatement or executeQuery

  2. def list[A](rowParser: RowParser[A])(implicit connection: Connection): Seq[A]

    Annotations
    @deprecated
    Deprecated

    (Since version 2.3.0) Use as with rowParser.*

  3. def parse[T](parser: ResultSetParser[T])(implicit connection: Connection): T

    Annotations
    @deprecated
    Deprecated

    (Since version 2.3.0) Use as

  4. def single[T](rowParser: RowParser[T])(implicit connection: Connection): T

    Annotations
    @deprecated
    Deprecated

    (Since version 2.3.0) Use as with rowParser.single

  5. def singleOpt[T](rowParser: RowParser[T])(implicit connection: Connection): Option[T]

    Annotations
    @deprecated
    Deprecated

    (Since version 2.3.0) Use as with rowParser.singleOpt

Inherited from AnyRef

Inherited from Any

Ungrouped