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
I'm using version 0.2.1 of this package via Swift Package Manager.
I have a user table with a primary key of id. I perform the following upsert query:
let data = MyModel(id: "abc", name: "Bob")
let query = supabase.database.from("user").upsert(values: data, returning: .minimal).select()
do {
try await query.execute()
} catch {
print(error)
}
✅ With no records in my table, the upsert succeeds by inserting a new row.
⛔️ If I immediately perform the same query again, I get a 409 error which means there's a conflict.
I assume this is because it's attempting to re-insert the same record again without doing an update instead.
Does upsert() work for anyone else and I'm just doing it wrong? 😅
The text was updated successfully, but these errors were encountered:
I'm using version
0.2.1
of this package via Swift Package Manager.I have a
user
table with a primary key ofid
. I perform the followingupsert
query:✅ With no records in my table, the
upsert
succeeds by inserting a new row.⛔️ If I immediately perform the same query again, I get a
409
error which means there's a conflict.I assume this is because it's attempting to re-
insert
the same record again without doing anupdate
instead.Does
upsert()
work for anyone else and I'm just doing it wrong? 😅The text was updated successfully, but these errors were encountered: