All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.augustnagro.magnum.SqlLiteral.scala Maven / Gradle / Ivy

The newest version!
package com.augustnagro.magnum

/** A SQL string that is interpolated directly into a sql"" query (and not as a
  * PreparedStatement parameter)
  *
  * For example,
  *
  * {{{
  *   val myQaSchema = SqlLiteral("db_qa")
  *   sql"SELECT * FROM $myQaSchema.table_name"
  * }}}
  *
  * Generates the SQL:
  * {{{
  *   "SELECT * FROM db_qa.table_name"
  * }}}
  */
trait SqlLiteral:
  def queryRepr: String

object SqlLiteral:
  def apply(s: String): SqlLiteral =
    new SqlLiteral:
      def queryRepr: String = s




© 2015 - 2025 Weber Informatics LLC | Privacy Policy