anchor.diff:          _ -> #{error => <<"View not found">>}
       end.
   
  --spec get_pretty_tuple(term()) -> {binary(), binary()}.
  -get_pretty_tuple(ParseTree) ->
  -    try sqlparse_fold:top_down(sqlparse_format_pretty, ParseTree, []) of
  +-spec format_options(oci | imem) -> list().
  +format_options(oci) -> [];
  +format_options(imem) -> [{case_keyword, lower}].
  +
  +-spec get_pretty_tuple(term(), oci | imem) -> {binary(), binary()}.
  +get_pretty_tuple(ParseTree, Adapter) ->
  +    Opts = format_options(Adapter),
  +    try sqlparse_fold:top_down(sqlparse_format_pretty, ParseTree, Opts) of
           {error, PrettyReason} ->
               ?Debug("Error ~p trying to get the pretty of the parse tree ~p",
                      [PrettyReason, ParseTree]),
  
positive.code:                             [{ParseTree, _}] = ParseTrees,
                              SqlTitle = get_sql_title(ParseTree),
                              FlatTuple = {<<"flat">>, Flat},
                              PrettyTuple = get_pretty_tuple(ParseTree),
                              ParseStmt = jsx:encode([{<<"parse_stmt">>,
                                  case SqlTitle of
                                      <<>> ->
  
negative.code:             {<<"prettyerror">>, iolist_to_binary(io_lib:format("~p:~p", [Class1, Error1]))}
      end.
  
  -spec get_pretty_tuple_multiple(list(), oci | imem) -> {binary(), binary()}.
  get_pretty_tuple_multiple(ParseTrees, Adapter) ->
      get_pretty_tuple_multiple(ParseTrees, [], Adapter).
  
  -spec get_pretty_tuple_multiple(list(), list(), oci | imem) -> {binary(), binary()}.
  get_pretty_tuple_multiple([], Result, _Adapter) ->
      %% Same as the flat we add ; and new line after each statement.
      {<<"pretty">>, iolist_to_binary([[Pretty, ";\n"] || Pretty <- lists:reverse(Result)])};
  get_pretty_tuple_multiple([ParseTree | Rest], Result, Adapter) ->
      case get_pretty_tuple(ParseTree, Adapter) of
          {<<"prettyerror">>, _} = Error -> Error;
          {<<"pretty">>, Pretty} -> get_pretty_tuple_multiple(Rest, [Pretty | Result])
      end.
  