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

Functions to write to a database #16

Open
vituri opened this issue Apr 26, 2024 · 3 comments
Open

Functions to write to a database #16

vituri opened this issue Apr 26, 2024 · 3 comments

Comments

@vituri
Copy link

vituri commented Apr 26, 2024

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
Copy link
Member

drizk1 commented Apr 26, 2024

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
Copy link
Member

drizk1 commented Apr 26, 2024

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

@vituri
Copy link
Author

vituri commented Apr 26, 2024

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.

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

No branches or pull requests

2 participants