Add support for getting json by array index
* Also support json negative array index
This commit is contained in:
committed by
Steve Chávez
parent
2513c00039
commit
30dfadec7b
@@ -238,7 +238,12 @@ instance Show LogicOperator where
|
||||
data LogicTree = Expr Bool LogicOperator [LogicTree] | Stmnt Filter deriving (Show, Eq)
|
||||
|
||||
type FieldName = Text
|
||||
type JsonPath = [Text]
|
||||
type JsonPath = [JsonPathOp]
|
||||
{-|
|
||||
Json path operands as specified in https://www.postgresql.org/docs/9.5/static/functions-json.html
|
||||
the array index is Text because we reuse our escaping functons and let pg do the casting with '1'::int
|
||||
-}
|
||||
data JsonPathOp = JKey{jpOp :: Text} | JIdx{jpOp :: Text} deriving (Show, Eq)
|
||||
type Field = (FieldName, JsonPath)
|
||||
type Alias = Text
|
||||
type Cast = Text
|
||||
|
||||
Reference in New Issue
Block a user