calasql-operations_2.13.0.1.9.source-code.TrimOps.scala Maven / Gradle / Ivy
The newest version!
package scalasql.operations
import scalasql.core.Expr
import scalasql.core.SqlStr.SqlStringSyntax
trait TrimOps {
protected def v: Expr[?]
/**
* Trim [[x]]s from the left hand side of the string [[v]]
*/
def ltrim(x: Expr[String]): Expr[String] = Expr { implicit ctx => sql"LTRIM($v, $x)" }
/**
* Trim [[x]]s from the right hand side of the string [[v]]
*/
def rtrim(x: Expr[String]): Expr[String] = Expr { implicit ctx => sql"RTRIM($v, $x)" }
}