Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visibility of fields of FunctionCall inadvertently changed to pub(crate) #676

Closed
magbak opened this issue Aug 14, 2023 · 1 comment · Fixed by #677
Closed

Visibility of fields of FunctionCall inadvertently changed to pub(crate) #676

magbak opened this issue Aug 14, 2023 · 1 comment · Fixed by #677

Comments

@magbak
Copy link
Contributor

magbak commented Aug 14, 2023

Description

In the bugfix #475 of issue #398, the enum variant SimpleExpr::FunctionCall(Function, Vec) was replaced by SimpleExpr::FunctionCall(FunctionCall). Since the fields of the struct FunctionCall are pub(crate), and the struct has no accessors, it is no longer possible to inspect the internals of a function. This functionality is essential for SQL-rewriting, and necessary to be able to make assertions about functions without making SQL-text.

Steps to Reproduce

Try to access FunctionCall args outside sea-query.

Expected Behavior

Have access to the inner structure of a function when using sea-query as a library, such as with e.g. SimpleExpr::Binary.

Actual Behavior

Inner structure of FunctionCall hidden from library users.

Reproduces How Often

Always.

Versions

Since the introduction of #475

Additional Information

Suggest either changing visibility of fields or providing pub getters if inappropriate ways of constructing FunctionCall is a concern.
Please let me know if I should make a pull request.

@tyt2y3
Copy link
Member

tyt2y3 commented Aug 14, 2023

Sure. I think pub getters are the way to go. PR is welcomed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants