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

Ts vector and ts query accepts language #15

Merged

Conversation

mrcosta
Copy link
Contributor

@mrcosta mrcosta commented Nov 5, 2019

closes #14

Copy link

@kaj kaj left a comment

Choose a reason for hiding this comment

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

Good addition of the config-specific functions.

Maybe the license file and misc cleanup should be separate pull requests?

@mrcosta
Copy link
Contributor Author

mrcosta commented May 24, 2020

hey @kaj, sorry for the late response. The LICENSE file was required by my company in order to use the crate. I've excluded from this current PR and I'll create a proper issue/PR with the license.

Let me know if you need anything else.

Copy link
Member

@weiznich weiznich left a comment

Choose a reason for hiding this comment

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

Looks fine module that semi related requested change there. It would be quite great to fix this minor issue along the way 😉

As another node: This needs to change the minimal supported diesel version, as the new sql_function! syntax is only available since 1.3.0. (Also I'm unsure if such a minimal version bump would require a major version bump for this crate. In this case we need to wait at least till the release of diesel 2.0 to issue a new release here)

src/lib.rs Outdated
Comment on lines 9 to 13
#[derive(Clone, Copy)]
pub struct TsQuery;

#[derive(Clone, Copy)]
pub struct TsVector;
Copy link
Member

Choose a reason for hiding this comment

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

Can you change that to use #[derive(SqlType)] as well? This would fix #19

(Requires removing the explicit HasSqlType and NotNull impls below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've updated, but I confess that I don't know the meaning of exactly what I'm doing =/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And @weiznich sorry but I didn't get what you meant in Looks fine module that semi related requested change there. It would be quite great to fix this minor issue along the way

Which module/which change/which fix?

Copy link
Member

Choose a reason for hiding this comment

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

It's a type, it's meant to be "modulo" instead of "module". So everything beside those small things is fine (+ the version bump for diesel + discussing how we should handle that)

Copy link
Member

@weiznich weiznich left a comment

Choose a reason for hiding this comment

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

Thanks for the update, but we need to explicitly configure the parameters for the HasSqlType implementation as shown below.

src/lib.rs Show resolved Hide resolved
src/lib.rs Show resolved Hide resolved
Copy link
Member

@weiznich weiznich left a comment

Choose a reason for hiding this comment

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

This change itself looks fine, but we need to bump the minimal supported diesel version to 1.3.0 to make this work as this is the first version that supports the new sql_function! syntax. I'm not sure how those bump would interact with semver constrains. Would this require a major version bump of diesel_full_text_search (in this case we should wait with releasing this change till the diesel 2.0 release) or would be a minor version bump be acceptable?

@kaj
Copy link

kaj commented May 28, 2020

I think that a since it is a minor version change the diesel requirement, it should be ok to do it on a minor (but not patch) version change in this crate.

But the change in diesel requirement (in Cargo.toml) needs to be either included in this PR or done separately before merging this PR.

@mrcosta
Copy link
Contributor Author

mrcosta commented May 28, 2020

Is just this that needs to be done? (and then someone that has authorisation does a cargo publish?)

@weiznich
Copy link
Member

This needs to fix the minimal supported diesel version here and I want to hear the opinion of @diesel-rs/contributors first on the sem version concerns.

@mrcosta
Copy link
Contributor Author

mrcosta commented May 28, 2020

Ok. I've pushed as if we would bump the version and minimum diesel version. Let me know if I should revert after you hear from them.

Copy link
Member

@weiznich weiznich left a comment

Choose a reason for hiding this comment

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

Looks good from my side

Copy link
Member

@JohnTitor JohnTitor left a comment

Choose a reason for hiding this comment

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

Considering that most users use caret requirements and diesel 1.3.0 was released two years ago, I think a minor release would be fine.

@kaj
Copy link

kaj commented May 30, 2020

Strange; github says this branch has no conflicts with the base branch, but the "old" code in the diff looks a lot different from what I see when looking at the master branch directly.

Also the functions phraseto_tsquery and websearch_to_tsquery does not exist in this branch and does exist in master, but still they don't seem to be removed by the diff here.

@kaj
Copy link

kaj commented May 30, 2020

Also, the update of the diesel dependency that is part of this PR should probably have been a part of #13 ?

@mrcosta
Copy link
Contributor Author

mrcosta commented May 31, 2020

@kaj thanks a lot. I don't know exactly where you're seeing this but think initially I applied rustfmt (and I revert to keep it simple for review) so maybe this is the reason why it looks different in what you mentioned as "old" code?

I agree about the bump version in the other PR, but I didn't have any idea about that at the time.

feedback about the comments (don't get me wrong, but I don't know exactly what to do here): is there an action item to be done or not?

@kaj
Copy link

kaj commented May 31, 2020

feedback about the comments (don't get me wrong, but I don't know exactly what to do here): is there an action item to be done or not?

I don't really know what would happen if this is merged as is, maybe there would be need for a manual merge (even if github claims not) and maybe it would remove the recently added support for phraseto_tsquery and websearch_to_tsquery.

I think it would be good to rebase this PR on the current master before merging, just to be safe.

@mrcosta mrcosta force-pushed the ts_vector_and_ts_query_accepts_language branch from 39bca60 to f84220e Compare May 31, 2020 10:22
@mrcosta
Copy link
Contributor Author

mrcosta commented May 31, 2020

You were right @kaj. I think now is ok regarding phraseto_tsquery and friend.

Copy link

@kaj kaj left a comment

Choose a reason for hiding this comment

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

Seems good now, I think it is ready to be merged (and released).

@weiznich weiznich merged commit 2e4dc75 into diesel-rs:master Jun 2, 2020
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.

add to_tsvector and to_tsquery that accepts search configuration
4 participants