Skip to content

[Drift] Unique constraint support and automatic Supabase upserts added to Kotlin SDK (powersync-kotlin #198) #426

Description

@benitav

What shipped: A new unique property has been added to the Index class in the Kotlin SDK, allowing developers to define unique constraints on schema tables. The SupabaseConnector now automatically detects these unique constraints and uses them to set the correct onConflict columns for Supabase upsert operations, falling back to primary key conflict resolution when no unique indexes are defined.

Why this needs docs: New public API addition (unique on Index) plus new automatic behavior in the Supabase connector that affects how writes are handled — users need to know how to use it and what behavior to expect.

Likely affected pages/sections:

  • Kotlin SDK schema reference — document the unique property on Index and UpsertOptions data class
  • Supabase integration guide (Kotlin) — document automatic upsert behavior, explain how the connector uses unique indexes for conflict resolution, and show an example schema with unique constraints

Source PR: powersync-ja/powersync-kotlin#198

CC: @benitav @fredpedersen

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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