Connecting to a database using dplyr with a date field in the database

Is there any magic to use dplyrto access the database when it has a date field?

A dplyr tbl_dfconverts mysql datetime fields to chr. It would not be so bad if I could return them. But if I do this before the collect()'in the table, I get an error that as.Date()is an invalid sql function. I can sort the workaround by calling collect(), but then I copy all the data from the database, which I was trying to avoid. Also, as soon as I'm collect()ed, its a data.frame, so if I want to join it with another tbl, I need to install copy=TRUEand copy it to memory.

+4
source share

Source: https://habr.com/ru/post/1568585/


All Articles