dibi icon indicating copy to clipboard operation
dibi copied to clipboard

Split query result by table

Open matejcik opened this issue 3 years ago • 0 comments

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.

matejcik avatar Mar 01 '22 11:03 matejcik