Data.Postgres
- Package
- purescript-postgresql
- Repository
- cakekindel/purescript-postgresql
#JSON Source
newtype JSON a
Newtype hinting that this value should be serialized / deserialized as a JSON string.
Constructors
JSON a
Instances
Newtype (JSON a) _
(Show a) => Show (JSON a)
(Eq a) => Eq (JSON a)
(Ord a) => Ord (JSON a)
(WriteForeign a) => WriteForeign (JSON a)
(ReadForeign a) => ReadForeign (JSON a)
(WriteForeign a) => Serialize (JSON a)
(ReadForeign a) => Deserialize (JSON a)
json
,jsonb
#modifyPgTypes Source
modifyPgTypes :: Effect Unit
This mutates import('pg').types
, setting deserialization
for some types to unmarshal as strings rather than JS values.
#isInstanceOfBuffer Source
isInstanceOfBuffer :: Foreign -> Boolean
#RepT Source
type RepT = ExceptT (NonEmptyList ForeignError) Effect
The serialization & deserialization monad.
#Serialize Source
class Serialize a where
Serialize data of type a
to a Raw
SQL value.
Members
Instances
Serialize Raw
Serialize Unit
NULL
Serialize Null
NULL
(WriteForeign a) => Serialize (JSON a)
json
,jsonb
Serialize Buffer
bytea
Serialize Int
int2
,int4
Serialize BigInt
int8
Serialize Boolean
bool
Serialize String
text
,inet
,tsquery
,tsvector
,uuid
,xml
,cidr
,time
,timetz
Serialize Number
float4
,float8
Serialize DateTime
interval
Serialize Interval
interval
Serialize Milliseconds
interval
Serialize Seconds
interval
Serialize Minutes
interval
Serialize Hours
interval
Serialize Days
interval
Serialize Instant
timestamp
,timestamptz
(Serialize a) => Serialize (Maybe a)
Just
->a
,Nothing
->NULL
(Serialize a) => Serialize (Array a)
postgres
array
(Ord a, Rep a) => Serialize (Range a)
#Deserialize Source
class Deserialize a where
Deserialize data of type a
from a Raw
SQL value.
Members
deserialize :: Raw -> RepT a
Instances
Deserialize Raw
Deserialize Unit
NULL
(always succeeds)Deserialize Null
NULL
(fails if non-null)(ReadForeign a) => Deserialize (JSON a)
json
,jsonb
Deserialize Buffer
bytea
Deserialize Interval
interval
Deserialize Milliseconds
interval
Deserialize Seconds
interval
Deserialize Minutes
interval
Deserialize Hours
interval
Deserialize Days
interval
Deserialize Int
int2
,int4
Deserialize BigInt
int8
Deserialize Boolean
bool
Deserialize String
text
,inet
,tsquery
,tsvector
,uuid
,xml
,cidr
,time
,timetz
Deserialize Number
float4
,float8
Deserialize DateTime
timestamp
,timestamptz
Deserialize Instant
timestamp
,timestamptz
(Deserialize a) => Deserialize (Array a)
postgres
array
(Deserialize a) => Deserialize (Maybe a)
non-NULL ->
Just
, NULL ->Nothing
(Ord a, Rep a) => Deserialize (Range a)
#Rep Source
class (Serialize a, Deserialize a) <= Rep a
A type which is Rep
resentable as a SQL value.
Instances
(Serialize a, Deserialize a) => Rep a
#unsafeSerializeCoerce Source
unsafeSerializeCoerce :: forall m a. Monad m => a -> m Raw
Coerces the value to Raw
.
This is only safe for values whose javascript representation
can be directly serialized by node-postgres
to the corresponding
SQL type.
- Modules
- Control.
Monad. Postgres - Control.
Monad. Postgres. Base - Control.
Monad. Postgres. Cursor - Control.
Monad. Postgres. Session - Data.
Postgres - Data.
Postgres. Custom - Data.
Postgres. Custom. Enum - Data.
Postgres. Interval - Data.
Postgres. Query - Data.
Postgres. Query. Builder - Data.
Postgres. Range - Data.
Postgres. Raw - Data.
Postgres. Result - Data.
Postgres. Unresult - Effect.
Aff. Postgres. Client - Effect.
Aff. Postgres. Pool - Effect.
Postgres. Client - Effect.
Postgres. Error - Effect.
Postgres. Error. Common - Effect.
Postgres. Error. Except - Effect.
Postgres. Error. RE - Effect.
Postgres. Pool - Node.
FS. PinnedVersion - Pipes.
Postgres
json
,jsonb