Skip to content

Add support for returning table alias on Columns(). #289

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

Merged
merged 1 commit into from
Jan 21, 2015

Conversation

chrismoos
Copy link
Contributor

Currently the driver discards the column alias and the original table
name. This change adds a new configuration parameter to include the
table alias with the column name.

This is useful because when mapping columns to structs, it is impossible
to distinguish between duplicate column names when doing JOIN queries.

pos += n

// Original table [len coded string]
n, err = skipLengthEncodedString(data[pos:])
originalTableName, _, n, err := readLengthEncodedString(data[pos:])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

originalTableName is never used. Please skip it then

@julienschmidt
Copy link
Member

bump

@julienschmidt julienschmidt added this to the v1.3 milestone Jan 20, 2015
@julienschmidt
Copy link
Member

LGTM when the last to changes are done 👍

Currently the driver discards the column alias and the original table
name. This change adds a new configuration parameter to include the
table alias with the column name.

This is useful because when mapping columns to structs, it is impossible
to distinguish between duplicate column names when doing JOIN queries.
@julienschmidt
Copy link
Member

Thank you!

julienschmidt added a commit that referenced this pull request Jan 21, 2015
Add support for returning table alias on Columns()
@julienschmidt julienschmidt merged commit 511937c into go-sql-driver:master Jan 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants