Replies: 3 comments
-
my suggestion, if possible, would be to make |
Beta Was this translation helpful? Give feedback.
0 replies
-
You can use func getColumn(columns ColumnList, colName string) (Column, error) {
for _, col := range columns {
if col.Name() == colName {
return col, nil
}
}
return nil, errors.New("no matched columns")
}
col, err := getColumn(Actor.AllColumns, "first_name")
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Maybe we can add |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there a way to construct dynamic order by using strings from, example, a http query parameter?
For example, if a request wants to sort by a column
id
for tableUsers
, then we can use this string to get theUsers.ID
column.Since I also wanted to reuse this functionality across different tables, I also tried implementing this function:
but the
columns()
method is unfortunately not exported for public usage. Just wondering what is the general practice for such use cases. Thanks!Beta Was this translation helpful? Give feedback.
All reactions