You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
insert_all() with list rows and hash_id= stores values in the wrong columns #997
table.insert_all() and table.upsert_all() accept rows as lists or tuples, with the column names first. With hash_id= or hash_id_columns=, no hash is computed and each value is stored one column to the left. This reproduces with sqlite-utils 4.2.2 and on main at ced72c7:
Expected output, the same as for dogs.insert_all([{"name": "Cleo", "twitter": "cleopaws"}], hash_id="id"). The hash matches the example in the hash_id documentation:
Rows that start with the same value get the same id. The second such row raises sqlite3.IntegrityError: UNIQUE constraint failed: dogs.id, and with ignore=True it is skipped without an error. upsert_all() stores the same shifted values. After a single-row upsert, last_pk is None (with use_old_upsert=True it is the row's first value).
Activity