anchor.diff:      ["SELECT ", FieldsSQL, " FROM ", Table,
        " ORDER BY ", OrderByStr].
   
  +%% @doc Generate a SELECT query for `RecName' rows.
  +%%
  +%% Example:
  +%% ```
  +%% SQL1 = sqerl_rec:gen_fetch(kitchen, name).
  +%% SQL1 = ["SELECT ", "id, name", " FROM ", "kitchens",
  +%%         " WHERE ", "name", " = $1"]
  +%%
  +%% SQL2 = sqerl_rec:gen_fetch(cook, [kitchen_id, name]),
  +%% SQL2 = ["SELECT ",
  +%%         "id, kitchen_id, name, auth_token, auth_token_bday, "
  +%%         "ssh_pub_key, first_name, last_name, email",
  +%%         " FROM ", "cookers", " WHERE ",
  +%%         "kitchen_id = $1 AND name = $2"]
  +%% '''
  +-spec gen_fetch(atom(), atom() | [atom()]) -> [string()].
   gen_fetch(RecName, By) when is_atom(By) ->
       AllFields = map_to_str(all_fields(RecName)),
       FieldsSQL = string:join(AllFields, ", "),
  
positive.code:     ["INSERT INTO ", Table, "(", InsertFieldsSQL,
       ") VALUES (", Params, ") RETURNING ", AllFieldsSQL].
  
  gen_fetch_page(RecName, OrderBy) ->
      AllFields = map_to_str(all_fields(RecName)),
      FieldsSQL = string:join(AllFields, ", "),
  
negative.code:     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),
  