-
Notifications
You must be signed in to change notification settings - Fork 16
SupabaseConnector does not support insert or replace #196
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
Comments
@fredpedersen The purpose of the |
I think for Kotlin specifically it's a reasonable request since we also ship a ready connector as part of the SDK (on the other SDK it's used for demos only). But it's also tricky to generate the upserts on clients because the local view of the schema doesn't know anything about which primary/unique keys exist on the database. |
My thoughts too @simolus3. The connector is part of the SDK rather than a demo, and should have the functionality that supabase already supports in their library. Additionally, it's messy to just override SupabaseConnector and add custom rules for indexes. Really, you also need to modify the Table and Index objects too. I have created a fork that adds the functionality needed |
Currently, the SupabaseConnector just uses insert, this will fail if there are constraints on the remote database.
A Powersync PUT is supposed to be insert or replace (SQLite doesnt have ON CONFLICT). For this we need to update the Table or Schema to be able to specific the unique constraints for each table. Then on uploadData we can do something like this but adding the data from the schema:
Is there a way already to do this that I'm missing?
The text was updated successfully, but these errors were encountered: