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

Improve sumo:find_by to make it more flexible – pagination/sorting params as options #307

Open
cabol opened this issue May 19, 2017 · 0 comments

Comments

@cabol
Copy link
Contributor

cabol commented May 19, 2017

Currently, when is needed to execute a query with sort params using find_by, you are forced to pass the pagination parameters as well. The proposal is to implement find_by/3:

-spec find_by(DocName, Conditions, Opts) -> Res when
  DocName    :: schema_name(),
  Conditions :: conditions(),
  Opts       :: #{atom() := term()},
  Res        :: [user_doc()].

There might be some common option like: limit, offset, etc., which will be defined and documented in sumo, but in general, each adapter could have its own options, and of course, they should be well documented.

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

No branches or pull requests

1 participant