I would like to write a Python script that would automate copying data from multiple SQLite3 databases into one PostgreSQL database.
Let me describe the situation: I have a folder with results from different marketing campaign that my colleague is doing. The results of each campaign is kept into one SQLite database. I want to create a centralized database in PostgreSQL to keep the results of each campaign that runs weekly.
My idea is to
- export the data from SQLite into a CSV file.
- create a temporary table in the PostgreSQL database
- check if the results in the new temp table already exist in my database and insert them or not.
I want to run a python script that once I run it, it will do this automatically.
Is there a better way ?
What about using SQLAlchemy ? It would be suitable for this project ? Is it worth learning it? By the way, I am beginner in Python :)
Aucun commentaire:
Enregistrer un commentaire