Skip to content

Any plans for Model.last and Query method? #3

@ChrisZou

Description

@ChrisZou

Hi @meyercm , sorry for coming to complain again. Do you have any plans for generating a last method(order_by: [desc: :inserted_at]) for model, just like ActiveRecord#last. I personally find it very useful.
Another feature I found useful is generating a bunch of methods that returns a Ecto.Query. These methods could be bundled up in a generated Module, like Model.Query.query_method.
For example.
User.Query.where(username: "chris") would return a Query similar to from(User, where: [username: "chris"]). This would simplify lots of boilerplate code when composing query or when using preload.
Sorry for my poor English, I hope I've made myself clear.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions