rql icon indicating copy to clipboard operation
rql copied to clipboard

Specify a Filter Name That Differs from the Column Name

Open jon-whit opened this issue 4 years ago • 3 comments

I'd like to have a property that is filterable but have the name of the filterable property be different than the name of the column that backs the property. For example

type User struct {
    FirstName string `json:"firstName" rql:"filter,name=firstName,column=first_name"`
}

So a filter like this

{
    "filter": {
        "firstName": "Bob"
    }
}

produces

WHERE first_name="Bob"

I don't see support for this currently. Is that correct? If so, would doing this be that difficult? I don't know the codebase very well, but this could be really useful for my team using this library.

jon-whit avatar Sep 11 '19 21:09 jon-whit

Thanks for opening this issue @jon-whit.

There's an ongoing PR for adding this support (#18). I'll try to push it this week.

a8m avatar Sep 12 '19 09:09 a8m

@a8m you're amazing! thanks for the quick response and the work :). If you could let me know when that's been resolved I'll close this guy out.

jon-whit avatar Sep 13 '19 04:09 jon-whit

@a8m any status update on this? I haven't seen any recent progress on #18

jon-whit avatar Oct 10 '19 22:10 jon-whit