-
Notifications
You must be signed in to change notification settings - Fork 1
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
How can I add the Kotlin serialization plugin or dependency? #4
Comments
In order to maintain parity with the Swift Supabase API, Skip's Supabase wrapper uses a custom CodableSerializer to handle encoding and decoding. This wasn't working for decoding previously, only encoding. I've just added some very basic support for Codable serialization in 0.0.4 (in #5). There is still a lot of work to be done to flesh it out, but it might be enough to get started with further enhancements and PRs. Take a look at SkipSupabaseTests to see what is implemented and what isn't. |
I am able to decode the data manually now thanks to the new changes, by using the new The |
The |
Decoding is now working when run in the framework tests, but if I add it to an app project it won't compile giving the error: This error is returned for the code: I created a new, clean app to confirm and it gives the same error. Changing the expected type to |
Are you sure you are using the latest version of skip-supabase? If you run Any what if you do more-or-less exactly what the test case does, does it still fail for you: let icountryResponse: PostgrestResponse<[Country]> = try await client
.from("countries")
.insert(Country(id: 1, name: "USA"), returning: PostgrestReturningOptions.representation)
.execute(options: FetchOptions(head: false, count: CountOption.exact))
try await assertCount("countries", count: 1)
let icountry: [Country] = icountryResponse.value |
I have tried to implement Kotlin code that works on an Android app directly with
SKIP INSERT:
but I keep getting the error:kotlinx.serialization.SerializationException: Serializer for class 'Country' is not found.
Please ensure that class is marked as '@Serializable' and that the serialization compiler plugin is applied.
Opening the app in Android Studio ends up saying
PLUGIN_IS_NOT_ENABLED
I have tried different methods to add the serialization plugin but nothing works. I'm also using the Supatodo sample app (https://github.com/skiptools/skipapp-supatodo)
What's the right way to add serialization?
Supabase uses kotlinx.serialization to decode the query data with
@Serializable
(https://supabase.com/docs/guides/getting-started/quickstarts/kotlin)The text was updated successfully, but these errors were encountered: