Giter Site home page Giter Site logo

Comments (5)

krlmlr avatar krlmlr commented on August 25, 2024

Thanks. Can you use dbAppendTable() or the like to create a temporary table on the database, and then use rows_append(copy = FALSE) to copy to the persistent table?

In the dbplyr issue, I see that dbWriteTable() has the same problem as rows_append() . Can you please provide more detail in how dbWriteTable() compares to dbAppendTable() ? What happens if the table is created with dbCreateTable() and then data is appended with dbAppendTable() ?

What does dbDataType() return for your data?

from rpostgres.

samterfa avatar samterfa commented on August 25, 2024

dbAppendTable() actually works fine already for appending data to a Redshift table with the appropriate datatype. This is why I thought the issue might be a dplyr or dbplyr issue instead. dplyr::rows_append() is broken for me and should work, but it's not my main concern at the moment since I can use the dbAppendTable() workaround.

What I'm really after is dplyr::rows_update() which is a really simple way to update rows of a database. I haven't found a good workaround for this. I am having trouble tracing what dplyr::rows_update() is doing and how the ecosystem of RPostgres, dbplyr, and dplyr work together.

from rpostgres.

krlmlr avatar krlmlr commented on August 25, 2024

Thanks. I'm typically using separate steps for bringing data into the database and updating a live data model:

  1. Copy data as temporary table
  2. Use rows_xxx(copy = FALSE) (the default)

This is a bit more tedious, but gives the best control.

from rpostgres.

krlmlr avatar krlmlr commented on August 25, 2024

Realizing I didn't really answer your rows_update() question.

rows_update() and the other rows_*() functions work best if the data is already in the database, e.g., in a temporary table. Then you can use update = FALSE to avoid copying, this simplifies the procedure. You prepare a table that contains the keys and new values you want to update, copy it to the database, and call rows_update() . Does that help?

from rpostgres.

samterfa avatar samterfa commented on August 25, 2024

We have moved to BigQuery so I am closing the issue. Thanks for all your help!

from rpostgres.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.