chore: update supabase and handle null entry in connector #77
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This updates to supabase-kt 3 (migration guide here) which requires updating to ktor 3 (migration guide here). There were only some minor changes required in the end.
This also includes handling postgres errors that are fatal and block the upload queue in the connectors uploadData function (more info on the issue here. This requires using an http interceptor to get the error code used in the regex check for fatal errors as the supabase-kt does not include it in it's error response https://github.com/supabase-community/supabase-kt/blob/68b9f7d61eb174a02bdc2cb01cb4c40eb8e8d1d9/Supabase/src/commonMain/kotlin/io/github/jan/supabase/exceptions/RestException.kt#L18.
I have created a feature request in
supabase-kt
for them to expose theresponse
so that we do not need to use the HTTP interceptor in the future. supabase-community/supabase-kt#774supabase
was removed from supabase-todolist demo's ``gradle.build` as Supabase is installed in the root and not required in the demo.Testing
I have run the supabase todolist app and added, updated and removed todos from both the mobile app and supabase and confirmed they are processed.
Showing an example when adding null if non-null constraint is applied in Supabase.
Update.Supabase.Connector.mov