Packages

p

anorm

postgresql

package postgresql

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. postgresql
  2. PGJson
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. implicit object JsObjectParameterMetaData extends ParameterMetaData[JsObject]
    Definition Classes
    PGJson
  2. implicit object JsValueParameterMetaData extends ParameterMetaData[JsValue]
    Definition Classes
    PGJson
  3. implicit val UUIDToSql: ToSql[UUID]

    Instance of ToSql to support PostgreSQL UUID parameter

  4. def asJson[T](value: T)(implicit w: Writes[T]): ParameterValue

    value

    the value to be passed as a JSON parameter

    w

    the Play writes to be used to serialized the value as JSON

    import play.api.libs.json._
    import anorm._, postgresql._
    
    case class Foo(bar: String)
    implicit val w: Writes[Foo] = Json.writes[Foo]
    
    val value = Foo("lorem")
    SQL"INSERT INTO test(id, json) VALUES(${"bar"}, ${value})".executeUpdate()
    Definition Classes
    PGJson
  5. def fromJson[T](implicit r: Reads[T]): Column[T]

    r

    the Play reader to be used from the selected JSONB value

    import play.api.libs.json.Reads
    import anorm.{ SQL, SqlParser }
    import anorm.postgresql._
    
    def foo(implicit r: Reads[Foo]): Foo
      SQL"SELECT json FROM test".
        as(SqlParser.scalar(fromJson[Foo]).single)
    Definition Classes
    PGJson
  6. implicit val jsObjectColumn: Column[JsObject]

    import play.api.libs.json.JsObject
    import anorm.{ SQL, SqlParser }
    import anorm.postgresql._
    
    SQL"SELECT json FROM test".as(SqlParser.scalar[JsObject].single)
    Definition Classes
    PGJson
  7. implicit val jsValueColumn: Column[JsValue]

    import play.api.libs.json.JsValue
    import anorm.{ SQL, SqlParser }
    import anorm.postgresql._
    
    SQL"SELECT json FROM test".as(SqlParser.scalar[JsValue].single)
    Definition Classes
    PGJson
  8. implicit def jsValueToStatement[J <: JsValue]: ToStatement[J]

    Allows to pass a JsValue as parameter to be stored as PGobject.

    Allows to pass a JsValue as parameter to be stored as PGobject.

    Definition Classes
    PGJson

Inherited from PGJson

Inherited from AnyRef

Inherited from Any

Ungrouped