Skip to content

Split query result by table #418

@matejcik

Description

@matejcik

An example is worth a thousand works, it would be cool if this worked:

$result = $database->query('SELECT * FROM books INNER JOIN authors ON books.author_id = author.id');

foreach ($result as $row->byTable()) {
	echo $row->books->name . " by " . $row->authors->name;
}

It would be nice to cache, and pass into rowFactory / rowClass, the result of getResultColumns(). That way a custom rowFactory could accomplish this easily.

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