anchor.diff:  offset(PerPage, Page) when Page > 0 ->
       (Page-1) * PerPage.
   
  -limit_clause(PerPage, Page) ->
  -    Offset = offset(PerPage, Page),
  -    [" limit ",integer_to_list(Offset),", ",integer_to_list(PerPage)].
  
positive.code: to_bool(undefined) ->   false;
  to_bool(_) ->       true.
  
  offset(PerPage, Page) when Page =< 0 ->
      offset(PerPage, 1);
  offset(PerPage, Page) when PerPage < 1 ->
  
negative.code: q_join([QFirstPart], []) ->
      QFirstPart.
  
  -spec encode(V) -> binary().
  %% @doc Safely encodes text for insertion into a query.  Replaces the atoms
  %% 'true' and 'false' with <<"1">> and <<"0">> respectively.
  encode(true) -> <<"1">>;
  encode(false) -> <<"0">>;
  encode(Other) -> emysql_util:encode(Other).
  