You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to add generic template based filter functions to Columns, Tables, Indexes, and ForeignKeys. I find myself often wanting to filter these slices on one or more properties but I feel directly coding it each time I need a new filter will be cumbersome.
It would look something like:
func (cColumns) FilterT(tstring) Columns {
//for column//execute template t//if result is truthy//add to result//return result
}
At this point, every user can define templates that render a truthy or falsey string. Then, they can easily filter in templates like this:
Feedback or alternative solutions are welcome. I don't love this implementation but I feel it is better than adding a bunch of custom filters to the code base every time we want something different.
The text was updated successfully, but these errors were encountered:
I would like to add generic template based filter functions to
Columns
,Tables
,Indexes
, andForeignKeys
. I find myself often wanting to filter these slices on one or more properties but I feel directly coding it each time I need a new filter will be cumbersome.It would look something like:
At this point, every user can define templates that render a truthy or falsey string. Then, they can easily filter in templates like this:
Feedback or alternative solutions are welcome. I don't love this implementation but I feel it is better than adding a bunch of custom filters to the code base every time we want something different.
The text was updated successfully, but these errors were encountered: