New :selectable
option to let users pluck columns out of a query
#537
Labels
:selectable
option to let users pluck columns out of a query
#537
Is your feature request related to a problem? Please describe.
I'm not sure this is in the scope of
Flop
, and if it isn't, I'm sorry.Lately, I've been wondering how to receive a
select
filter option, e.g./resource?select=name,city
, so that I can output my entity, but with the only filtered fields (name
andcity
in the above example).Should Flop help with this problem? I personally instinctively reached to Flop to solve this.
Describe the solution you'd like
Right now, with
Flop
, we can write:This allows my endpoint to receive
/resource?name=some&this=thing&that=else&page=0&page_size=10
.I'll just feed this to
Flop
and call it a day. Great.I would love the same just works™ feel, but with an additional
:selectable
option.The above would allow to receive
/resource?name=some&this=thing&that=else&page=0&page_size=10&select=name,city
, andFlop
would the results (filtered by other options), but it wouldSELECT
justname
andcity
out of it.Describe alternatives you've considered
Simply, to implement this by hand: params validation and
Ecto
's:select
option. Pain.The text was updated successfully, but these errors were encountered: