Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get alias of specific column #15

Open
madshov opened this issue Dec 5, 2017 · 1 comment
Open

Get alias of specific column #15

madshov opened this issue Dec 5, 2017 · 1 comment

Comments

@madshov
Copy link

madshov commented Dec 5, 2017

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
}
@kisielk
Copy link
Owner

kisielk commented Dec 5, 2017

Not at the moment, but that's something which could be added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants