github supabase-community/supabase-kt 0.9.0-alpha-2

latest releases: 3.7.0, 3.7.0-beta-1, 3.6.0...
pre-release3 years ago

Changes

  • Add new json function property to PostgrestBuilder#insert and PostgrestBuilder#update (to customize Json encoding)

  • Add new PostgrestBuilder#update overload to use an DTO instead of the DSL:

    client.postgrest["test"].update(SomeData(2)) {
        eq("id", 2)
    }
  • Add new overloads to PostgrestFilterBuilder: sl (rangeLt), sr (rangeGt), nxr (rangeLte), nxl (rangeGte)

  • Add new methods to PostgrestFilterBuilder: cs/contains, cd/contained, ov/overlaps

  • Change value type of PostgrestFilterBuilder methods sl, sr, nxl, nxr to LongRange instead of String

  • Add new config property propertyConversionMethod to Postgrest:

    You can now specify which method postgrest-kt should use to convert a property to a column name:

    If you have this data class:

    @Serializable
    data class Test(
        @SerialName("some_property") val someProperty: String
    )

    And want to use this syntax:

    client.postgrest["table"].select {
       Test::someProperty eq "test"
    }

    you can now specify how someProperty gets converted to a column name in the Postgrest config:

    val client = createSupabaseClient(url, key) {
       install(Postgrest) {
           propertyConversionMethod = PropertyConversionMethod.SERIAL_NAME //only works for JVM/Android
           //or 
           propertyConverisonMethod = PropertyConversionMethod.CAMEL_CASE_TO_SNAKE_CASE //works for all platforms
           //or write your own (defaults to CAMEL_CASE_TO_SNAKE_CASE 
       }
    }

    depending on the method the resulting column name will either be the @SerialName value or the property name just gets converted to snake case.
    Note: same works for the update DSL

  • Make values in PostgrestUpdate nullable

  • Add Postgrest Tests

  • Remove deprecated methods in Storage

  • Remove experimental annotations

Don't miss a new supabase-kt release

NewReleases is sending notifications on new releases.