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

Missing (or difficult-to-find) documentation for `eq`, `gt`, etc. #607

Closed
trombonehero opened this Issue Feb 2, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@trombonehero

trombonehero commented Feb 2, 2017

Diesel provides lots of DSL sugar, and from the examples I can figure out how to do things like:

users.filter(created.gt(/* ... */))

However, I can't find a list of eq, gt, etc., in the documentation, so I don't know what predicates are supported. For example, there's probably a way to write a "non-null" predicate, but I can't find it in the documentation. Maybe it does exist, but if so, some indexing may be required...

@sgrif

This comment has been minimized.

Member

sgrif commented Feb 2, 2017

http://docs.diesel.rs/diesel/expression/expression_methods/global_expression_methods/trait.ExpressionMethods.html#method.eq

The docs have a search function, that method is the first result when searching for eq. The method for IS NOT NULL is called is_not_null, and is documented here (again, found by typing is_not_null into the search bar)

@sgrif sgrif closed this Feb 2, 2017

@trombonehero

This comment has been minimized.

trombonehero commented Feb 2, 2017

It's true that is_not_null is documented, but to find that documentation I need to know either:

  1. that it's called is_not_null (which is the thing I wanted to learn) or
  2. that the list of such expressions are documented in diesel::expression::expression_methods::global_expression_methods::ExpressionMethods.

My suggestion is that something between the high-level http://diesel.rs/guides/getting-started and the low-level API docs could be helpful for people trying to learn Diesel. Something like "here's how these SQL clauses translate into Diesel expressions" would be great.

@sgrif

This comment has been minimized.

Member

sgrif commented Feb 2, 2017

Yes, writing a guide on this is the second one on the list that I give for people who reach out to help with the docs.

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