added a datatype for local queries and a compiler from it into SQL