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

sqlite3.IntegrityError: UNIQUE constraint failed #55

Open
lkc0626 opened this issue Nov 13, 2023 · 0 comments
Open

sqlite3.IntegrityError: UNIQUE constraint failed #55

lkc0626 opened this issue Nov 13, 2023 · 0 comments

Comments

@lkc0626
Copy link

lkc0626 commented Nov 13, 2023

Hello,

I'm using this library to check Google Safe Browsing URLs.
I have collected responses from "get_threats_update" into JSON and then tried to insert them into the DB.
However, after inserting it into DB for a while, it gives me this integrity error at line 323 in Storage.py (when inserting hash_prefix with populate_hash_prefix_list function):
sqlite3.IntegrityError: UNIQUE constraint failed: hash_prefix.value, hash_prefix.threat_type, hash_prefix.platform_type, hash_prefix.threat_entry_type

For this function, is it possible to add INSERT OR IGNORE? or does it need to check for integrity?
What should happen if integrity fails? Is it supposed to get a full update instead of a partial update?

Thank you in advance.

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

1 participant