Skip to content

Conversation

@jakeboone02
Copy link
Member

No description provided.

@jakeboone02 jakeboone02 merged commit 337c4d2 into main Jun 19, 2022
@jakeboone02 jakeboone02 deleted the v450 branch June 19, 2022 00:15
@fasiha
Copy link

fasiha commented Jun 22, 2022

Minor issue, forgive me if this isn't a good place to leave it—the documentation for transformQuery https://react-querybuilder.js.org/docs/api/misc#transformquery doesn't mention the ruleProcessor field of QueryTransformerOptions.

@jakeboone02
Copy link
Member Author

@fasiha good catch. It is mentioned in the descriptive paragraph, but not in the list of options. I'll fix that shortly.

@fasiha
Copy link

fasiha commented Jun 22, 2022

Ahh, indeed it is in the paragraph, I just didn't read closely enough, sorry for the false alarm! Maybe future readers who are impatient like me will appreciate it in the list 😅

@fasiha
Copy link

fasiha commented Jun 22, 2022

I'm newly grateful for transformQuery, not only did it simplify the logic of preparing a rule with arithmetic scalars, I'm returning to it once again to transform stringy values to lowercase. (Making certain fields case insensitive is another one of those niche use cases that probably make more sense to leave to developers to add by leveraging the tooling you've already provided in the library, rather than try and accommodate in the library itself.)

@jakeboone02
Copy link
Member Author

I'm really glad you're finding it so useful. It was fun to write!

Your parenthetical remark is absolutely right...but it also has me thinking again about supporting functions somehow. Not a critical feature of course, but if it was done right it might be nice.

At my day job we tend to leave the values alone but assign a caseInsensitive: true property to the relevant field objects. Then when the query gets transformed to the API format, caseInsensitive gets merged into each rule and the API wraps the appropriate values in an UPPER call in the actual SQL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants