Skip to content

Get alias of specific column #15

@madshov

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
}

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