remove build_insert_query, use dbAppendTable directly #2552
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Switches from hand-rolling our own insert queries to copying whole table using DBI::dbAppendTable.
Motivation and Context
Using DBI's interface instead of rolling our own was always a good idea in the abstract, but our hand is forced now because
build_insert_query
breaks when usingglue
1.3.2 -- strings get wrapped in two sets of single-quotes instead of one. I think this is because we were passing SQL vectors toglue_sql
, which expects plain text and assumes it needs to do all its own quoting and escaping. It was probably only by accident that passing SQL vectors worked right before.First observed while testing #2545, and #2545 probably won't pass CI until this patch is merged, but they're not otherwise related.
Review Time Estimate
Types of changes
Checklist: