0 | module Oracle.Types.JSONQuery
 1 |
 2 | import Oracle.Types.BindParameter
 3 |
 4 | ||| A query whose selected expression is expected to produce a JSON value.
 5 | |||
 6 | ||| The expression is wrapped by queryJSON as: JSON_SERIALIZE(expression RETURNING CLOB)
 7 | |||
 8 | ||| The resulting CLOB is then returned to Idris as a String.
 9 | |||
10 | ||| `querybody` should contain the FROM clause and any additional SQL clauses required to identify the rows being queried.
11 | |||
12 | ||| For example:
13 | |||
14 | |||   MkJSONQuery
15 | |||     "payload"
16 | |||     "documents"
17 | |||     []
18 | |||
19 | ||| Produces SQL equivalent to:
20 | |||
21 | |||   SELECT JSON_SERIALIZE(payload RETURNING CLOB)
22 | |||   FROM documents
23 | |||
24 | public export
25 | record JSONQuery where
26 |   constructor MkJSONQuery
27 |   expression : String
28 |   querybody  : String
29 |   binds      : List BindParameter
30 |