Skip to content

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

@cabol

Description

@cabol

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions