Executes this SQL statement as query, returns result as Row stream.
Executes this SQL statement as query, returns result as Row stream.
Executes this statement as query and convert result as T
, using parser.
Executes this statement as query and convert result as T
, using parser.
Prepares query as a simple one.
Prepares query as a simple one.
Row parser
import anorm.{ SQL, SqlParser } SQL("SELECT 1").asSimple(SqlParser.scalar[Int])
Executes this SQL statement.
Executes this SQL statement.
true if resultset was returned from execution (statement is query), or false if it executed update
Executes this SQL as an insert statement.
Executes this SQL as an insert statement.
Parser for generated key (default: scalar long)
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
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
Executes this SQL as an update statement.
Executes this SQL as an update statement.
Count of updated row(s)
(Since version 2.3.0) Use getFilledStatement or executeQuery
Initial SQL query, without parameter values.