typson-selda-0.1.0.0: Typson Selda Integration
Copyright(c) Aaron Allen 2020
LicenseBSD-style (see the file LICENSE)
MaintainerAaron Allen <aaronallen8455@gmail.com>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Typson.Selda

Description

 
Synopsis

Documentation

jsonPath Source #

Arguments

:: (TypeAtPath o tree path ~ target, ReflectPath path) 
=> proxy (path :: k)

A path proxy

-> ObjectTree tree o

Typson schema

-> Col PG (Json o)

Column selector

-> Col PG (Json target) 

Use a type-safe JSON path as part of a query.

query $ jsonPath (Proxy @("foo" :-> "bar")) fieldSchemaJ
      . (! #field)
    <$> select someTable

newtype Json a Source #

Use this wrapper on fields that are serialized as JSON in the database. It's deserialization treats SQL NULL as JSON null.

Constructors

Json 

Fields

Instances

Instances details
Eq a => Eq (Json a) Source # 
Instance details

Defined in Typson.Selda

Methods

(==) :: Json a -> Json a -> Bool #

(/=) :: Json a -> Json a -> Bool #

Ord a => Ord (Json a) Source # 
Instance details

Defined in Typson.Selda

Methods

compare :: Json a -> Json a -> Ordering #

(<) :: Json a -> Json a -> Bool #

(<=) :: Json a -> Json a -> Bool #

(>) :: Json a -> Json a -> Bool #

(>=) :: Json a -> Json a -> Bool #

max :: Json a -> Json a -> Json a #

min :: Json a -> Json a -> Json a #

Show a => Show (Json a) Source # 
Instance details

Defined in Typson.Selda

Methods

showsPrec :: Int -> Json a -> ShowS #

show :: Json a -> String #

showList :: [Json a] -> ShowS #

ToJSON a => ToJSON (Json a) Source # 
Instance details

Defined in Typson.Selda

FromJSON a => FromJSON (Json a) Source # 
Instance details

Defined in Typson.Selda

(Typeable a, ToJSON a, FromJSON a, Show a) => SqlType (Json a) Source # 
Instance details

Defined in Typson.Selda

Methods

mkLit :: Json a -> Lit (Json a) #

sqlType :: Proxy (Json a) -> SqlTypeRep #

fromSql :: SqlValue -> Json a #

defaultValue :: Lit (Json a) #