Skip to content

Upserting not working #96

Closed
Closed
@bwship

Description

@bwship

Bug report

Describe the bug

I am trying to upsert data. The first time I run it, it works fine, and it inserts the reocrd into the table. But any subsequent times it returns back either a 400 or 409 error.

To Reproduce

struct Basic: Encodable {
    var id: Int
}
func upsertData() async throws {
    do {
        let item = Basic(id: 4)
        try await client.database
                        .from("test")
                        .upsert(values: item)
                        .execute()
    } catch {
        print("Error executing the query: \(error)")
    }
}

Expected behavior

It should allow the upsert to happen. This is the most basic version of it with just one column, but it also fails on my normal table.

System information

  • OS: macOS
  • Version of supabase-swift: 0.3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions