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

Avoid duplicating emails in export file #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

incogbyte
Copy link

Updated the export_sql_users function to prevent duplicate emails from being written into the export file.

Previously, the function was overwriting the file and writing all the emails fetched from the database, regardless of whether they already existed in the file.

The function now checks if the file exists, reads all existing emails into a set, and only writes emails that do not already exist in the file. The file is now opened in append mode to preserve existing emails.

This change optimizes the export process and avoids unnecessary duplication of data, i think 📦

Updated the export_sql_users function to prevent duplicate emails from being written into the export file. 

Previously, the function was overwriting the file and writing all the emails fetched from the database, regardless of whether they already existed in the file. 

The function now checks if the file exists, reads all existing emails into a set, and only writes emails that do not already exist in the file. The file is now opened in append mode to preserve existing emails. 

This change optimizes the export process and avoids unnecessary duplication of data, i think 📦
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

Successfully merging this pull request may close these issues.

1 participant