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

Automatic retrieval of primary keys overrides columns of joined tables with same column name #16

Open
alranel opened this issue May 4, 2018 · 0 comments
Labels

Comments

@alranel
Copy link
Owner

alranel commented May 4, 2018

Suppose we are doing the following:

my $rs = $dbix->table('foo')->left_join('bar', { 'bar_id' => 'id' })->select('bar.id');

Also suppose we defined id as primary key for table foo. DBIX::Lite will automatically retrieve that column in order to make $row->update() work. However, that overrides our ->select('bar.id').

When primary keys are automatically added by _select_sth_for_object() they should be aliased with a private name, used as primary key by $row->update().

@alranel alranel added the bug label May 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant