sqlstruct
sqlstruct copied to clipboard
Get alias of specific column
Is there any way of getting the aliased column name for a given column? ie:
q := fmt.Sprintf(`
SELECT %s
FROM product p
WHERE reference = ?`, sqlstruct.ColumnsAliased(p, "p"))
if sort["col"] != "" {
q += fmt.Sprintf(`
ORDER BY %s %s`, sort["col"], sort["order"]) <--- here I would like the alias instead
}
Not at the moment, but that's something which could be added.