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

Add plainto_tsquery_with_search_config #41

Merged
merged 1 commit into from
Apr 11, 2024

Conversation

eth3lbert
Copy link
Contributor

This PR adds plainto_tsquery_with_search_config, which respects plainto_tsquery(config regconfig, query text ) → tsquery.

Copy link

@DavisRayM DavisRayM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only question/concern here is that it looks oddly similar to to_tsquery here which also takes Text which I'm assuming is plain text here. They seem to be the same function to me ? Or am I missing something ?

Copy link

@DavisRayM DavisRayM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, seems I was missing something; This seems related to the Postgres parsing function of the same name. Guessing this maps down to that parsing function ?

Seems the macro is deprecated; Still checking how this maps down but for now this looks good to me. 🚀 LGTM, maps down to the correct query

@weiznich
Copy link
Member

Actually, seems I was missing something; This seems related to the Postgres parsing function of the same name.

The problem there is that rust does not allow function overloading, therefore we generate a different function for different sets of arguments and try to name them as close as possible to the original function name.

Seems the macro is deprecated; Still checking how this maps down but for now this looks good to me.

Just to clarify this a bit: The macro will be deprecated in the next minor diesel release. It will be replaced with the define_sql_function! macro that just structures the output a bit differently. The main motivation for this is to resolve certain to name resolution problems in the generated code.

@weiznich weiznich merged commit a1484bf into diesel-rs:master Apr 11, 2024
6 checks passed
@eth3lbert eth3lbert deleted the plainto-tsquery branch April 11, 2024 07:58
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