Combining AND / OR filters with SELECT function in @aws-appsync/utils/rds (createPgStatement)

0

I'm trying to use the new Aurora resolver tools in Appsync, but it seems that the select utility function is incomplete.

It appears that there is not a supported operator for IN LIST, so my backup attempt was to use several "eq" filters in an "or" list. The problem is that when combining "or" filters with other unrelated filters, the helper function does not separate the "or" items with parenthesis.

For example:

"filter": {
        "vendor": {"eq": "No Vendor"},
        "or": [{"txnNumber": {"eq": 162228}},
                 {"txnNumber": {"eq": 162460}}]
          },

Creates the following query:

WHERE \"vendor\" = :P0 AND (\"txnNumber\" = :P1) OR (\"txnNumber\" = :P2) LIMIT :P3 OFFSET :P4"

I know I can create my SQL statement in a more manual fashion, but I'd rather not recreate logic for the simpler filter values. Is there a hybrid approach that would allow me to use the helper function for the simpler FilterTypes, but allow me to implement an IN LIST type?

Is there a road map for adding IN LIST and improving the "OR" behavior?

BenM
已提问 4 个月前78 查看次数
没有答案

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则