| Copyright | (c) Aaron Allen 2020 |
|---|---|
| License | BSD-style (see the file LICENSE) |
| Maintainer | Aaron Allen <aaronallen8455@gmail.com> |
| Stability | experimental |
| Portability | non-portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Typson.Esqueleto
Description
Synopsis
- jsonPath :: (TypeAtPath o tree path ~ field, ReflectPath path, PostgreSqlJSON json) => proxy (path :: k) -> ObjectTree tree o -> SqlExpr (Value (json o)) -> SqlExpr (Value (NullableJSONB field))
- newtype NullableJSONB a = NullableJSONB {
- unNullableJSONB :: a
- class PostgreSqlJSON (json :: * -> *)
Documentation
Arguments
| :: (TypeAtPath o tree path ~ field, ReflectPath path, PostgreSqlJSON json) | |
| => proxy (path :: k) | A path proxy |
| -> ObjectTree tree o | Typson schema |
| -> SqlExpr (Value (json o)) | Column selector |
| -> SqlExpr (Value (NullableJSONB field)) |
Use a type-safe JSON path as part of a query.
select . from $ entity ->
pure . jsonPath (Proxy @("foo" :-> "bar")) fieldSchemaJ
$ entity ^. Field
newtype NullableJSONB a Source #
Treats SQL NULL as a JSON null
Constructors
| NullableJSONB | |
Fields
| |
Instances
class PostgreSqlJSON (json :: * -> *) Source #
Members of this class are type constructors used to respresent Postgres JSON columns.
Instances
| PostgreSqlJSON JSONB Source # | |
Defined in Typson.Esqueleto | |
| PostgreSqlJSON NullableJSONB Source # | |
Defined in Typson.Esqueleto | |