Skip to content

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

@alranel

Description

@alranel

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().

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions