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

remove build_insert_query, use dbAppendTable directly #2552

Merged
merged 2 commits into from Mar 26, 2020

Conversation

infotroph
Copy link
Member

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 using glue 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 to glue_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

  • Immediately
  • Within one week
  • When possible

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the CHANGELOG.md.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@mdietze mdietze merged commit ffeff66 into PecanProject:develop Mar 26, 2020
@infotroph infotroph deleted the dont-build-query branch April 14, 2020 20:42
@robkooper robkooper added this to the 1.8.0 milestone Apr 14, 2020
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

3 participants