-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"All object keys must match" error on Insert #26
Comments
I get the same thing in my setup. Still trying to get around this issue |
@srector13 Please inform me if you find any workaround |
@srector13 I found a workaround: Let's suppose you have this code: struct Todo: Codable { let todo = Todo(text: "Example todo!", integerval: String(123) , boolval: "false") let jsonData: Data = try JSONEncoder().encode(todo) client.database.from("todos") All you have to do is to convert the Codable's Item Structure to String for all inputs even if they are Boolean, Int etc. |
Hey guys, thanks for reporting this, that workaround shouldn't be needed, let me take a look and go back to you once I have a solution. Thanks! |
@billypap1 and @srector13 can you point the |
@GRSouza I updated the package and tried with the 0.0.2 version, again the same issue -> "All object keys must match" . PS. I use this library for db operations, not supabase-swift |
@billypap1 I've setup an integration tests along with a local supabase instance in the Can you provide a sample project that contains the issue you're having? Or point me at your project if it's public. That way I can clone it and debug it on my machine. |
FYI, we worked around this issue on postgrest-js with supabase/postgrest-js#175. |
FWIW I just put this package I would be happy to provide a sample project but at this point its literally the same thing as @srector13's suggestion |
@GRSouza I was getting the same issue, and just tried the latest I followed the unit tests you linked above, which were super helpful as well (the new |
@richthornton can you explain? Is 0.0.2 not the latest? |
@SergioB-dev apologies, I presumed that the The other change I made at the same time was changing the code to follow the format that was in the test cases. Using @billypap1's example above, the code would be:
The difference is removing the json encoding and serialisation lines. When I try the two versions locally, this change seems to fix the issue for me. Hopefully it solves it for you as well 🤞. If not if you post another minimal reproduction I can try helping narrow down the differences between our setups. |
I'll close this as it seems to be working with the latest package versions. |
Hello, I have integrated Supabase-Swift to my project.
When I try to insert a row, I receive this error - > "All object keys must match"
Even if I include in my Codable Item values like id which is auto generated in db.
The text was updated successfully, but these errors were encountered: