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

select parameter constraint #1560

Closed
sackery opened this Issue Feb 16, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@sackery

sackery commented Feb 16, 2018

    pub fn load_select<Selection, T>(nid: i64, selection: Selection, conn: &PgConnection) -> QueryResult<T>
        where Selection: ???,
              T: ???
    {
        node::table.find(nid)
                   .select(selection)
                   .first(conn)
    }
@sgrif

This comment has been minimized.

Member

sgrif commented Feb 17, 2018

Probably T: Queryable<Selection::SqlType>, Selection: SelectableExpression<node::table>. Follow the compiler errors and ask more specific questions if you don't understand the constraints it claims aren't holding.

@sgrif sgrif closed this Feb 17, 2018

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