Bot releases are visible (Hide)
Published by jan-tennert 9 months ago
The documentation has been updated accordingly.
It might take a bit to appear on Maven Central, as publishing seems to be broken right now
Add iOS targets to the chat-demo by @hieuwu in #397
Realtime.Config#disconnectOnNoSubscriptions
) to automatically disconnect from the websocket, once there is no channel left, which defaults to true. (in #416 by @jan-tennert)Note: For both methods, the flows automatically emit the initial data and then listen for events using the existing methods.
Listen for changes in all messages (handles inserts, updates and deletes automatically and emits the updated list)
val messageFlow: Flow<List<Message>> = channel.postgresListDataFlow<Message>( //provide your serializable type (in this case Message)
table = "messages",
filter = FilterOperation("id", FilterOperator.IN, listOf(1, 2, 3, 4)), //optional filter
primaryKey = Message::id //provide the primary key for caching
)
Listen for changes on a single value
val singleMessageFlow: Flow<Message> = channel.postgresSingleDataFlow<Message>( //Automatically emits the updated message and closes on delete
table = "messages",
primaryKey = Message::id
) { //this is the same filter builder the Postgrest plugin uses, so you can use everything:
Message::id eq 2
or {
Message::creatorId isIn listOf("1", "2", "3")
Message::content like "%test%"
}
}
Listen to presence changes (joins & leaves are handled automatically)
val presenceFlow: Flow<List<User>> = channel.presenceDataFlow<User>()
supabase.channel("channel").postgresChangeFlow<PostgresAction>("public") {
//Still only one filter supported
filter("id", FilterOperator.EQ, 2)
//Note that some values get converted to strings e.g. the List<Int> to (1,2,3)
filter("id", FilterOperator.IN, listOf(1, 2, 3, 4))
}
New methods:
RealtimeChannel#postgresSingleDataFlow
RealtimeChannel#postgresListDataFlow
RealtimeChannel#presenceDataFlow
RealtimeChannelBuilder#filter
Published by jan-tennert 9 months ago
Published by jan-tennert 9 months ago
I decided to skip wasm support this release and going to release 2.1.0 soon once the documentation update is up. Wasm will probably be in 2.2.0. Wasm support in Ktor is taking longer than expected.
Published by jan-tennert 9 months ago
It might take a while for the next stage/actual release as I'm still waiting to merge wasm support (blocked by ktor)
RealtimeChannel#postgresListDataFlow
by @jollygreenegiant in https://github.com/supabase-community/supabase-kt/pull/421
Published by jan-tennert 10 months ago
Realtime.Config#disconnectOnNoSubscriptions
) to automatically disconnect from the websocket, once there is no channel left, which defaults to true. (in #416 by @jan-tennert)Note: For both methods, the flows automatically emit the initial data and then listen for events using the existing methods.
Listen for changes in all messages (handles inserts, updates and deletes automatically and emits the updated list)
val messageFlow: Flow<List<Message>> = channel.postgresListDataFlow<Message>( //provide your serializable type (in this case Message)
table = "messages",
filter = FilterOperation("id", FilterOperator.IN, listOf(1, 2, 3, 4)), //optional filter
primaryKey = Message::id //provide the primary key for caching
)
Listen for changes on a single value
val singleMessageFlow: Flow<Message> = channel.postgresSingleDataFlow<Message>( //Automatically emits the updated message and closes on delete
table = "messages",
primaryKey = Message::id
) { //this is the same filter builder the Postgrest plugin uses, so you can use everything:
Message::id eq 2
or {
Message::creatorId isIn listOf("1", "2", "3")
Message::content like "%test%"
}
}
Listen to presence changes (joins & leaves are handled automatically)
val presenceFlow: Flow<List<User>> = channel.presenceDataFlow<User>()
supabase.channel("channel").postgresChangeFlow<PostgresAction>("public") {
//Still only one filter supported
filter("id", FilterOperator.EQ, 2)
//Note that some values get converted to strings e.g. the List<Int> to (1,2,3)
filter("id", FilterOperator.IN, listOf(1, 2, 3, 4))
}
New methods:
RealtimeChannel#postgresSingleDataFlow
RealtimeChannel#postgresListDataFlow
RealtimeChannel#presenceDataFlow
RealtimeChannelBuilder#filter
Published by jan-tennert 10 months ago
(might take a little bit to appear on maven central)
Published by jan-tennert 10 months ago
PostgrestFilterBuilder#textSearch
producing an invalid query (by @jan-tennert in #409)Published by jan-tennert 10 months ago
Add wasm-js
target in supabase-kt
, gotrue-kt
, realtime-kt
, storage-kt
, functions-kt
, postgrest-kt
https://maven.pkg.jetbrains.space/kotlin/p/wasm/experimental
wasm-js
implementation works the same as js
mingwX64
, linuxX64
, macosX64
targets are not supported due to the experimental ktor version.Published by jan-tennert 10 months ago
Auth#linkIdentity
updateLocalUser
parameter to Auth#unlinkIdentity
Auth#awaitInitialization
, which blocks the current coroutine until the sessionStatus
changes from SessionStatus.LoadingFromStorage
.Published by jan-tennert 10 months ago
GoTrue
plugin to Auth
GoTrueConfig
to AuthConfig
SupabaseClient#gotrue
to SupabaseClient#auth
Auth#loginWith
to Auth#signInWith
Auth#logout
to Auth#signOut
LogoutScope
to SignOutScope
Auth#sendOtpTo
and add new OTP
auth provider (in #350 by @jan-tennert):supabase.auth.signInWith(OTP) {
email = "[email protected]"
}
supabase.auth.signInWith(SSO) {
domain = "domain"
}
AdminUserUpdateBuilder#phoneNumber
to AdminUserUpdateBuilder#phone
UserUpdateBuilder#phoneNumber
to UserUpdateBuilder#phone
Phone.Config#phoneNumber
to Phone.Config#phone
Auth#sendRecoveryEmail
to Auth#resetPasswordForEmail
and add PKCE support (in #367 by @jan-tennert)Auth#linkIdentity(OAuthProvider)
- The works the same as signInWith(OAuthProvider)
but links an additional OAuth provider to an authenticated userAuth#unlinkIdentity(identityId)
Auth#currentIdentitiesOrNull
Realtime#createChannel
to Realtime#channel
RealtimeChannel#join
and add new RealtimeChannel#subscribe
method, which does the same but also connects to the realtime websocket automaticallyRealtime.Config#connectOnSubscribe
to disable this behaviourRealtimeChannel#leave
to RealtimeChannel#unsubscribe
SupabaseClient#channel
extension function delegating to Realtime#channel
Realtime.Status
to reflect the new methods:
UNSUBSCRIBED
SUBSCRIBING
SUBSCRIBED
UNSUBSCRIBING
upsert
parameter in insert
and update
methods and add new upsert
methodreturning
, count
and single
parameters from postgrest methodsval result = supabase.postgrest["messages"].select {
single() //receive an object rather than an array
count(Count.EXACT) //receive amount of database entries
limit(10) //limit amount of results
range(2, 3) //change range of results
select() //return the data when updating/deleting/upserting (same as settings 'returning' to REPRESENTATION before)
filter {
eq("id", 1)
}
}
val result = supabase.postgrest["messages"].select {
csv() //receive data as csv
geojson() //receive data as geojson
explain(/* */) //debug queries
}
PostgrestResult#count
to PostgrestResult#countOrNull
PostgrestResult#range
to PostgrestResult#rangeOrNull
SupabaseClient#from
delegating to Postgrest#from
PostgrestResult#body
to PostgrestResult#data
PostgrestResult#data
to String
PostgrestResult
: (especially handy when dealing with datatypes other than json)val (data, headers) = supabase.from("countries").select {
csv()
}
ComposeAuth#rememberLoginWithGoogle
to ComposeAuth#rememberSignInWithGoogle
ComposeAuth#rememberLoginWithApple
to ComposeAuth#rememberSignInWithApple
ComposeAuth#rememberSignOut
to ComposeAuth#rememberSignOutWithGoogle
This new plugin can be added to a Coil ImageLoader to easily display images from public and non-public buckets from storage (Android only)
(in #323 by @jan-tennert).
Learn more
This new plugin can be added to a ImageLoader to easily display images from public and non-public buckets from storage (All Compose targets) (in #335 by @jan-tennert).
Learn more
Published by jan-tennert 11 months ago
No changes since last beta
Final version will be released once the documentation update has been merged.
Published by jan-tennert 11 months ago
Published by jan-tennert 11 months ago
If you can, please start to try out the 2.0.0 version(s) as there are alot of breaking changes from 1.5.X and I cannot test everything! :)
Migration guide will be on the development branch soon! Initial version: here
Auth#sendRecoveryEmail
to Auth#resetPasswordForEmail
and add PKCE support (in #367 by @jan-tennert)Auth#linkIdentity(OAuthProvider)
- The works the same as signInWith(OAuthProvider)
but links an additional OAuth provider to an authenticated userAuth#unlinkIdentity(identityId)
Auth#currentIdentitiesOrNull
Published by jan-tennert 11 months ago
Authorization
header not getting added to any request when Auth
is not installedcolumns
parameter to PostgrestRequestBuilder#select
to allow restricting which columns to receive when using UPDATE
, DELETE
, INSERT
Published by jan-tennert 11 months ago
Note: As this is a major version, this update contains breaking changes so be sure to read the changelog fully!
And feedback is definitely welcome and needed!
SupabaseClient#standaloneSupabaseModule
(because this function was misused a lot, you can essentially do the same by creating a SupabaseClient and then just call SupabaseClient#module
)GoTrue
plugin to Auth
GoTrueConfig
to AuthConfig
SupabaseClient#gotrue
to SupabaseClient#auth
Auth#loginWith
to Auth#signInWith
Auth#logout
to Auth#signOut
LogoutScope
to SignOutScope
Auth#sendOtpTo
and add new OTP
auth provider (in #350 by @jan-tennert):supabase.auth.signInWith(OTP) {
email = "[email protected]"
}
supabase.auth.signInWith(SSO) {
domain = "domain"
}
AdminUserUpdateBuilder#phoneNumber
to AdminUserUpdateBuilder#phone
UserUpdateBuilder#phoneNumber
to UserUpdateBuilder#phone
Phone.Config#phoneNumber
to Phone.Config#phone
Realtime#createChannel
to Realtime#channel
RealtimeChannel#join
and add new RealtimeChannel#subscribe
method, which does the same but also connects to the realtime websocket automaticallyRealtime.Config#connectOnSubscribe
to disable this behaviourRealtimeChannel#leave
to RealtimeChannel#unsubscribe
SupabaseClient#channel
extension function delegating to Realtime#channel
Realtime.Status
to reflect the new methods:
UNSUBSCRIBED
SUBSCRIBING
SUBSCRIBED
UNSUBSCRIBING
upsert
parameter in insert
and update
methods and add new upsert
methodreturning
, count
and single
parameters from postgrest methodsval result = supabase.postgrest["messages"].select {
single() //receive an object rather than an array
count(Count.EXACT) //receive amount of database entries
limit(10) //limit amount of results
range(2, 3) //change range of results
select() //return the data when updating/deleting/upserting (same as settings 'returning' to REPRESENTATION before)
filter {
eq("id", 1)
}
}
val result = supabase.postgrest["messages"].select {
csv() //receive data as csv
geojson() //receive data as geojson
explain(/* */) //debug queries
}
PostgrestResult#count
to PostgrestResult#countOrNull
PostgrestResult#range
to PostgrestResult#rangeOrNull
SupabaseClient#from
delegating to Postgrest#from
PostgrestResult#body
to PostgrestResult#data
PostgrestResult#data
to String
PostgrestResult
: (especially handy when dealing with datatypes other than json)val (data, headers) = supabase.from("countries").select {
csv()
}
ComposeAuth#rememberLoginWithGoogle
to ComposeAuth#rememberSignInWithGoogle
ComposeAuth#rememberLoginWithApple
to ComposeAuth#rememberSignInWithApple
ComposeAuth#rememberSignOut
to ComposeAuth#rememberSignOutWithGoogle
This new plugin can be added to a Coil ImageLoader to easily display images from public and non-public buckets from storage (Android only)
(in #323 by @jan-tennert).
Learn more
This new plugin can be added to a ImageLoader to easily display images from public and non-public buckets from storage (All Compose targets) (in #335 by @jan-tennert).
Learn more
Published by jan-tennert 11 months ago
GoTrue
: DEPRECATED -> Replaced by Auth
supabaseClient#gotrue
: DEPRECATED -> Replaced by supabaseClient#auth
GoTrue#loginWith
: DEPRECATED -> Replaced by GoTrue#signInWith
GoTrueConfig
-> Renamed to AuthConfig
GoTrueExt.kt
-> Renamed to AuthExtensions.kt
GoTrueImpl
-> Renamed to AuthImpl
This won't break existing apps, you will just get deprecation warnings
This new plugin can be added to a Coil ImageLoader to easily display images from public and non-public buckets from storage (Android only)
(in #323 by @jan-tennert).
Learn more
This new plugin can be added to a ImageLoader to easily display images from public and non-public buckets from storage (All Compose targets) (in #335 by @jan-tennert).
Learn more
Published by jan-tennert 12 months ago
UserInfo#appMetadata
type to JsonObject
to allow access to all keys and valuesPublished by jan-tennert 12 months ago
Published by jan-tennert 12 months ago
PostgrestUpdate#set
PostgrestUpdate
when not using KotlinX SerializationPublished by jan-tennert 12 months ago