add schema functions and queries