Skip to content

Update with joined tables #49

@ggl

Description

@ggl

The current update method cannot take any join statements nor can it be worked around to do so without setting the quote_char argument to an empty string.

I'd like to modify the update method so that it's able to take an array reference as the $table argument. In this array reference one would specify scalar reference elements so that these become non-quoted raw SQL statements. This would be useful for speficying raw join conditions, such as:

UPDATE t1 JOIN t2 ON t1.col1=t2.col2 SET t1.col3=t2.col4 ...

Also, this can also be extended towards array reference elements in order to specify table aliases. This behaviour is consistent with the select method:

my ($query, $binds) = $builer->select([\'t1 JOIN t2 ON t1.col1=t2.col2'], ['*'], $where, $opt);

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