Compatibility with Nette 2.2

Me neither. Maybe this function should be moved form nette/database to nette/utils.