Skip to content

SupabaseConnector does not support insert or replace #196

Closed
@fredpedersen

Description

@fredpedersen

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:

table.upsert(data) {
                            onConflict = "timestamp,user_id"
                            ignoreDuplicates = false
                        }

Is there a way already to do this that I'm missing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions