Skip to content

.upsert() with hash_id throws error #84

@simonw

Description

@simonw
db[table_name].upsert_all(rows, hash_id="pk")

This throws an error: PrimaryKeyRequired('upsert() requires a pk')

The problem is, if you try this:

db[table_name].upsert_all(rows, hash_id="pk", pk="pk")

You get this error: AssertionError('Use either pk= or hash_id=')

hash_id= should imply that pk= that column.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions