nette / database

💾 A database layer with a familiar PDO-like API but much more powerful. Building queries, advanced joins, drivers for MySQL, PostgreSQL, SQLite, MS SQL Server and Oracle.
https://doc.nette.org/database
Other
512 stars 108 forks source link

Fix Invalid argument supplied for foreach() for empty aggregations #309

Closed temistokles closed 3 months ago

temistokles commented 3 months ago

In case an aggregation returns 0 rows, the fetch returns null and foreach triggers a warning.

Use-case e.g.: $selection->aggregation('MEDIAN(WEEKDAY(created)) OVER ()', 'MEDIAN')