Skip to content

Get alias of specific column #15

Description

@madshov

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
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions