added db functions for window functionality

can we change this to either strings wrapped in parens (concatenates all the strings for you), or preferably to a block string?