TidierOrg / TidierDB.jl

Tidier database analysis in Julia, modeled after the dbplyr R package.
MIT License
35 stars 3 forks source link

Functions to write to a database #16

Open vituri opened 2 months ago

vituri commented 2 months ago

We now have tools to collect data from databases using the TidierData language, but what about writing to databases?

In R, I had to create a function that saves a temporary csv file and then upload it to MariaDB. I was able to do the same with Julia. This has the advantage of choosing whether to insert with REPLACE or IGNORE duplicate keys.

Do you plan to add these kinds of function to TidierDB? I can help with the MySQL/MariaDB part.

drizk1 commented 2 months ago

I have thought about if and how to add write functions. dbplyr does have a set of functions that do so, which would probably be the method/syntax of how we go about adding them. So right now the plan is TBD I'd say.

SQLstrings is an interesting package I have thought about as an example for how to safely write to the underlying database.

drizk1 commented 2 months ago

For MySql and MariaDB is there no way to do it without a csv intermediary ? I'm just curious.

vituri commented 2 months ago

In R the DBI package has some function to write tables to databases, but they are extremely slow; probably write line by line. I don't know of any approach to this in Julia.