Skip to content

Commit

Permalink
Remove unused rdbms_queries:update/5 function
Browse files Browse the repository at this point in the history
  • Loading branch information
arcusfelis committed Feb 5, 2021
1 parent abc5a1a commit c7974d7
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions src/rdbms/rdbms_queries.erl
Original file line number Diff line number Diff line change
Expand Up @@ -113,24 +113,6 @@ update_t(Table, Fields, Vals, Where) ->
join_escaped(Vals) ->
join([mongoose_rdbms:use_escaped(X) || X <- Vals], ", ").


update(LServer, Table, Fields, Vals, Where) ->
UPairs = lists:zipwith(fun(A, B) -> [A, "=", mongoose_rdbms:use_escaped(B)] end,
Fields, Vals),
case mongoose_rdbms:sql_query(
LServer,
[<<"update ">>, Table, <<" set ">>,
join(UPairs, ", "),
<<" where ">>, Where, ";"]) of
{updated, 1} ->
ok;
_ ->
mongoose_rdbms:sql_query(
LServer,
[<<"insert into ">>, Table, "(", join(Fields, ", "),
<<") values (">>, join_escaped(Vals), ");"])
end.

-spec execute_upsert(Host :: mongoose_rdbms:server(),
Name :: atom(),
InsertParams :: [any()],
Expand Down

0 comments on commit c7974d7

Please sign in to comment.