Compiles a queryable into something compatible with a datasource.