def get_SQL(self, schema, query, **sql_options):
only_where_clause = sql_options.get('<STR_LIT>', False)<EOL>symbol_map = {<EOL>'<STR_LIT>': {'<STR_LIT>': '<STR_LIT>', '<STR_LIT:list>': True},<EOL>'<STR_LIT>': {'<STR_LIT>': '<STR_LIT>', '<STR_LIT:list>': True},<EOL>'<STR_LIT>': {'<STR_LIT>': '<STR_LIT:=>', '<STR_LIT>': '<STR_LIT>'},<EOL>'<STR_LIT>': {'<STR_LIT>': '<STR_LIT>', '<STR_LIT>': '<STR_LIT>'},<EOL>'<STR_LIT>': {'<STR_LIT>': '<STR_LIT:>>'},<EOL>'<STR_LIT>': {'<STR_LIT>': '<STR_LIT>'},<EOL>'<STR_LIT>': {'<STR_LIT>': '<STR_LIT:<>'},<EOL>'<STR_LIT>': {'<STR_LIT>': '<STR_LIT>'},<EOL>'<STR_LIT>': {'<STR_LIT>': '<STR_LIT>'},<EOL>'<STR_LIT>': {'<STR_LIT>': '<STR_LIT>'},<EOL>}<EOL>query_args = []<EOL>query_str = []<EOL>if not only_where_clause:<EOL><INDENT>query_str.append('<STR_LIT>')<EOL>select_fields = query.fields_select<EOL>if select_fields:<EOL><INDENT>distinct = "<STR_LIT>" if select_fields.options.get("<STR_LIT>", False) else "<STR_LIT>"<EOL>select_fields_str = distinct + '<STR_LIT>'.format(os.linesep).join(<EOL>(self._normalize_name(f) for f in select_fields.names())<EOL>)<EOL><DEDENT>else:<EOL><INDENT>select_fields_str = "<STR_LIT:*>"<EOL><DEDENT>if sql_options.get('<STR_LIT>', False):<EOL><INDENT>query_str.append('<STR_LIT>'.format(select_fields_str))<EOL><DEDENT>else:<EOL><INDENT>query_str.append('<STR_LIT>'.format(select_fields_str))<EOL><DEDENT>query_str.append('<STR_LIT>')<EOL>query_str.append("<STR_LIT>".format(self._normalize_table_name(schema)))<EOL><DEDENT>if query.fields_where:<EOL><INDENT>query_str.append('<STR_LIT>')<EOL>for i, field in enumerate(query.fields_where):<EOL><INDENT>if i > <NUM_LIT:0>: query_str.append('<STR_LIT>')<EOL>field_str = '<STR_LIT>'<EOL>field_args = []<EOL>sd = symbol_map[field[<NUM_LIT:0>]]<EOL>_, field_name, field_val, field_kwargs = field<EOL>field_str, field_args = self._normalize_val_SQL(<EOL>schema,<EOL>sd,<EOL>field_name,<EOL>field_val,<EOL>field_kwargs<EOL>)<EOL>query_str.append('<STR_LIT>'.format(field_str))<EOL>query_args.extend(field_args)<EOL><DEDENT><DEDENT>if query.fields_sort:<EOL><INDENT>query_sort_str = []<EOL>query_str.append('<STR_LIT>')<EOL>for field in query.fields_sort:<EOL><INDENT>sort_dir_str = '<STR_LIT>' if field[<NUM_LIT:0>] > <NUM_LIT:0> else '<STR_LIT>'<EOL>if field[<NUM_LIT:2>]:<EOL><INDENT>field_sort_str, field_sort_args = self._normalize_sort_SQL(field[<NUM_LIT:1>], field[<NUM_LIT:2>], sort_dir_str)<EOL>query_sort_str.append(field_sort_str)<EOL>query_args.extend(field_sort_args)<EOL><DEDENT>else:<EOL><INDENT>query_sort_str.append('<STR_LIT>'.format(field[<NUM_LIT:1>], sort_dir_str))<EOL><DEDENT><DEDENT>query_str.append('<STR_LIT>'.format(os.linesep).join(query_sort_str))<EOL><DEDENT>if query.bounds:<EOL><INDENT>offset = query.bounds.offset<EOL>limit = <NUM_LIT:1> if sql_options.get('<STR_LIT>', False) else query.bounds.limit<EOL>query_str.append('<STR_LIT>'.format(<EOL>limit,<EOL>offset<EOL>))<EOL><DEDENT>query_str = os.linesep.join(query_str)<EOL>return query_str, query_args<EOL>
convert the query instance into SQL

this is the glue method that translates the generic Query() instance to
the SQL specific query, this is where the magic happens

**sql_options -- dict
    count_query -- boolean -- true if this is a count query SELECT
    only_where_clause -- boolean -- true to only return after WHERE ...