-
-
Notifications
You must be signed in to change notification settings - Fork 0
New implementation to better handle upsert #10
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
Conversation
I removed this bit of a test: # Now update a column that's part of the compound primary key
time.sleep(0.1)
if pks == ["id", "name"]:
db[table_name].update((2, "Pancakes"), {"name": "Pancakes the corgi"})
# This should have renamed the row in the chronicle table as well
renamed_row = db[chronicle_table].get((2, "Pancakes the corgi"))
assert renamed_row["updated_ms"] > version
else:
# Update single primary key
db[table_name].update(2, {"id": 4})
# This should have renamed the row in the chronicle table as well
renamed_row = db[chronicle_table].get(4)
assert renamed_row["updated_ms"] > version |
This code here: sqlite-chronicle/sqlite_chronicle.py Lines 229 to 246 in 5c28eee
Assumes that sqlite-chronicle/sqlite_chronicle.py Lines 121 to 129 in 5c28eee
|
I switched to a window function to assign those incrementing version numbers as part of that initial insert. https://chatgpt.com/share/681e5184-0448-8006-bd11-67be8379161e |
Refs:
TODO:
updates_since()
working correctly