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
According to this example, if I do the same as what the example says, I'm getting an error.
awaitAccount.insert(
Account(
number=account.number,
balance=account.balance,
token=account.token,
password=account.password,
device_id=account.device_id,
)
).on_conflict(
action="DO UPDATE",
target=Account.number, # Adding this will fix the error but not included in the example in the documentation.values=[Account.token],
)
asyncpg.exceptions.PostgresSyntaxError: ONCONFLICTDOUPDATErequiresinferencespecificationorconstraintnameHINT: Forexample, ONCONFLICT (column_name).