Add layoutBoxes SQL function definition