protected override string FormatSql(UpdateStatement update, WherePart wherePart) { return SqlFormatter.FormatUpdate(update, wherePart); }
public static string FormatUpdate(UpdateStatement update, WherePart wherePart) { var setClause = string.Join(", ", update.Columns.Zip(update.Values, (c, p) => $"{c} = @{p.Name}")); return $@"UPDATE {QuoteDottedIdentifier(update.Table.QualifiedName)} SET {setClause} WHERE {FormatWherePart(wherePart)} RETURNING *"; }
protected abstract string FormatSql(UpdateStatement command, WherePart wherePart);