Replacing runtime statements with DatabaseFunction instances