Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add upsert support with an additonal parameter "onduplicate" #198

Closed
wants to merge 342 commits into from

Conversation

ktmud
Copy link

@ktmud ktmud commented Apr 30, 2017

This should suffice most the use cases as described in #68 and #194.

I'm adding a new parameter instead of replacing "append" to have a better backward compatibility support.

jeroen and others added 30 commits February 19, 2015 18:37
Replace isnan() with R's ISNAN(), as described in Writing R Extensions:

> Functions/macros such as isnan, isinf and isfinite are not required by
> C++98: where compilers support them they may be only in the std
> namespace or only in the main namespace. There is no way to make use
> of these functions which works with all C++ compilers currently in use
> on R platforms: use R’s versions such as ISNAN and R_FINITE instead.
> -- [R Core Team,Writing R Extensions: Portable C and C++ code]
> (https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Portable-C-and-C_002b_002b-code)

This prevents the following error when trying to build RMySQL on my
Mac OS X 10.7:

    MyBinding.h:100: error: ‘isnan’ was not declared in this scope

Further reading:
* https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Portable-C-and-C_002b_002b-code
* https://stat.ethz.ch/pipermail/r-devel/2005-January/thread.html#31793
* https://stat.ethz.ch/pipermail/r-devel/2005-January/thread.html#31800
* http://lists.apple.com/archives/Xcode-users/2006/Aug/thrd7.html#00619
* http://lists.apple.com/archives/Xcode-users/2006/Aug/thrd7.html#00633
* http://stackoverflow.com/questions/18128899/is-isnan-in-the-std-namespace-more-in-general-when-is-std-necessary-optio
* http://stackoverflow.com/questions/2249110/how-do-i-make-a-portable-isnan-isinf-function
* http://stackoverflow.com/questions/570669/checking-if-a-double-or-float-is-nan-in-c
Use ISNAN() to prevent build error on OS X 10.7
@krlmlr
Copy link
Member

krlmlr commented Jun 30, 2017

Thanks for looking into it. The dbWriteTable() method is defined and specified by DBI, but not all DBMS support UPSERT, and those DBMS that support it may have different semantics. Before accepting this, I'd like to derive an interface that is likely to work with other DBMS.

How does this work in PostgreSQL, SQL Server, or Oracle?

@GoChartingAdmin
Copy link

+1 Critical Functionality. Appreciate if it can be merged into the package

@jeroen
Copy link
Member

jeroen commented Feb 25, 2018

New features go into the RMariaDB package.

@jeroen jeroen closed this Feb 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants