Module

Data.Postgres.Raw

Package
purescript-postgresql
Repository
cakekindel/purescript-postgresql

#jsNull Source

jsNull :: Raw

Literal javascript null

#isNull Source

isNull :: Raw -> Boolean

a === null

#Null Source

data Null

The SQL value NULL

Constructors

Instances

#Raw Source

data Raw

A raw JS value converted from SQL

In practice, this is an alias for Foreign with type system guarantees that purescript types are correctly represented in JS to be represented in SQL.

Instances

  • Show Raw
  • (Warn (Text "`Eq Raw` only checks equality for JS primitives, and is always `false` for objects.")) => Eq Raw

#rawToDebugString Source

rawToDebugString :: Raw -> String

Stringifies a Raw value if a JS primitive, else returns a debug representation.

  • {foo: 'bar'} -> "[Object]"
  • [1, 2, 3] -> "[Array]"
  • 'foo' -> "foo"
  • 123 -> "123"

#rawDebugEq Source

rawDebugEq :: Raw -> Raw -> Boolean

Performs JS referential equality === for primitives or arrays of primitives, else returns false.

#rawMaybeNull Source

#rawNullMaybe Source

#unsafeFromForeign Source

unsafeFromForeign :: Foreign -> Raw

Coerce a Foreign value to Raw.

This is only safe if the Foreign value is guaranteed to be serializable to a SQL value via pg-types.

#asForeign Source

asForeign :: Raw -> Foreign

Coerce a Raw value to Foreign.