anchor.diff:      Params = [ "$" ++ erlang:integer_to_list(I) || I <- lists:seq(1, N) ],
       string:join(Params, ", ").
   
  +%% @doc Return a SQL DELETE query appropriate for module `RecName'
  +%% implementing the `sqerl_rec' behaviour. Example:
  +%%
  +%% ```
  +%% SQL = gen_delete(user, id),
  +%% SQL = ["DELETE FROM ","cookers"," WHERE ","id"," = $1"]
  +%% '''
  +-spec gen_delete(atom(), atom()) -> [string()].
   gen_delete(RecName, By) ->
       ByStr = to_str(By),
       Table = table_name(RecName),
       ["DELETE FROM ", Table, " WHERE ", ByStr, " = $1"].
   
  +%% @doc Generate an UPDATE query. Uses ``RecName:'#update_fields'/0''
  +%% to determine the fields to include for SET.
  +%%
  +%% Example:
  +%% ```
  +%% SQL = sqerl_rec:gen_update(cook, id),
  +%% SQL = ["UPDATE ","cookers"," SET ",
  +%%        "name = $1, auth_token = $2, ssh_pub_key = $3, "
  +%%        "first_name = $4, last_name = $5, email = $6",
  +%%        " WHERE ","id"," = ","$7"]
  +%% '''
  +-spec gen_update(atom(), atom()) -> [string()].
   gen_update(RecName, By) ->
       UpdateFields = RecName:'#update_fields'(),
       ByStr = to_str(By),
  
positive.code:     ["UPDATE ", Table, " SET ", KeyVals,
       " WHERE ", ByStr, " = ", LastParam].
  
  gen_insert(RecName) ->
      InsertFields = map_to_str(RecName:'#insert_fields'()),
      InsertFieldsSQL = string:join(InsertFields, ", "),
  
negative.code:      " WHERE ", OrderByStr, " > $1 ORDER BY ", OrderByStr,
       " LIMIT $2"].
  
  %% @doc Generate a query to return all rows
  %%
  %% Example:
  %% ```
  %% SQL = sqerl_rec:gen_fetch_all(kitchen, name),
  %% SQL = ["SELECT ", "id, name", " FROM ", "kitchens",
  %%        " ORDER BY ", "name"]
  %% '''
  -spec gen_fetch_all(atom(), atom()) -> [string()].
  gen_fetch_all(RecName, OrderBy) ->
      AllFields = map_to_str(all_fields(RecName)),
      FieldsSQL = string:join(AllFields, ", "),
  