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

Help embedding UncheckedBind into a query #1287

Closed
csharad opened this Issue Oct 31, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@csharad
Contributor

csharad commented Oct 31, 2017

Here is the query I would like to achieve. MATCH sql works if the parameter is hardcoded but I am not able to work out a solution with bind.

    let mut query = jobs::table.into_boxed();
    if let Some(q) = search.query() {
        query = query
            .filter(sql::<Bool>("MATCH (title, description, qualification) AGAINST (?)")
            .bind::<Text, _>(q));
    }
    if let Some(salary_range) = search.salary_range() {
        query = query.filter(jobs::salary
                .ge(salary_range.lower())
                .and(jobs::salary
                    .le(salary_range.upper())));
    }

And does multiple filters result in and condition? How should I approach this problem?

@csharad csharad closed this Dec 29, 2017

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