DatabaseKt

public final class DatabaseKt


Summary

Public fields

final @NonNull Flow<@NonNull ChildEvent>

This field is deprecated. Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.

final @NonNull FirebaseDatabase

Accessing this object for Kotlin apps has changed; see the migration guide.

final @NonNull Flow<@NonNull DataSnapshot>

This field is deprecated. Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.

Public methods

static final @NonNull FirebaseDatabase

Accessing this object for Kotlin apps has changed; see the migration guide.

static final @NonNull FirebaseDatabase

Accessing this object for Kotlin apps has changed; see the migration guide.

static final @NonNull FirebaseDatabase
DatabaseKt.database(
    @NonNull Firebase receiver,
    @NonNull FirebaseApp app,
    @NonNull String url
)

Accessing this object for Kotlin apps has changed; see the migration guide.

static final T
<T extends Object> DatabaseKt.getValue(@NonNull DataSnapshot receiver)

This method is deprecated. Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.

static final T
<T extends Object> DatabaseKt.getValue(@NonNull MutableData receiver)

This method is deprecated. Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.

static final @NonNull Flow<T>
<T extends Object> DatabaseKt.values(@NonNull Query receiver)

This method is deprecated. Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.

Public fields

childEvents

public final @NonNull Flow<@NonNull ChildEventchildEvents

Starts listening to this query's child events and emits its values via a Flow.

  • When the returned flow starts being collected, a ChildEventListener will be attached.

  • When the flow completes, the listener will be removed.

Deprecation Notice: The Kotlin extensions (KTX) APIs have been added to their respective main modules, and the Kotlin extension (KTX) APIs in com.google.firebase.firebase-database-ktx are now deprecated. As early as April 2024, we'll no longer release KTX modules. For details, see the FAQ about this initiative.

database

public final @NonNull FirebaseDatabase database

Accessing this object for Kotlin apps has changed; see the migration guide.

Returns the FirebaseDatabase instance of the default FirebaseApp.

Deprecation Notice: The Kotlin extensions (KTX) APIs have been added to their respective main modules, and the Kotlin extension (KTX) APIs in com.google.firebase.firebase-database-ktx are now deprecated. As early as April 2024, we'll no longer release KTX modules. For details, see the FAQ about this initiative.

snapshots

public final @NonNull Flow<@NonNull DataSnapshotsnapshots

Starts listening to this query and emits its values via a Flow.

  • When the returned flow starts being collected, a ValueEventListener will be attached.

  • When the flow completes, the listener will be removed.

Deprecation Notice: The Kotlin extensions (KTX) APIs have been added to their respective main modules, and the Kotlin extension (KTX) APIs in com.google.firebase.firebase-database-ktx are now deprecated. As early as April 2024, we'll no longer release KTX modules. For details, see the FAQ about this initiative.

Public methods

DatabaseKt.database

public static final @NonNull FirebaseDatabase DatabaseKt.database(@NonNull Firebase receiver, @NonNull FirebaseApp app)

Accessing this object for Kotlin apps has changed; see the migration guide.

Returns the FirebaseDatabase instance of the given FirebaseApp.

Deprecation Notice: The Kotlin extensions (KTX) APIs have been added to their respective main modules, and the Kotlin extension (KTX) APIs in com.google.firebase.firebase-database-ktx are now deprecated. As early as April 2024, we'll no longer release KTX modules. For details, see the FAQ about this initiative.

DatabaseKt.database

public static final @NonNull FirebaseDatabase DatabaseKt.database(@NonNull Firebase receiver, @NonNull String url)

Accessing this object for Kotlin apps has changed; see the migration guide.

Returns the FirebaseDatabase instance for the specified url.

Deprecation Notice: The Kotlin extensions (KTX) APIs have been added to their respective main modules, and the Kotlin extension (KTX) APIs in com.google.firebase.firebase-database-ktx are now deprecated. As early as April 2024, we'll no longer release KTX modules. For details, see the FAQ about this initiative.

DatabaseKt.database

public static final @NonNull FirebaseDatabase DatabaseKt.database(
    @NonNull Firebase receiver,
    @NonNull FirebaseApp app,
    @NonNull String url
)

Accessing this object for Kotlin apps has changed; see the migration guide.

Returns the FirebaseDatabase instance of the given FirebaseApp and url.

Deprecation Notice: The Kotlin extensions (KTX) APIs have been added to their respective main modules, and the Kotlin extension (KTX) APIs in com.google.firebase.firebase-database-ktx are now deprecated. As early as April 2024, we'll no longer release KTX modules. For details, see the FAQ about this initiative.

DatabaseKt.getValue

public static final T <T extends Object> DatabaseKt.getValue(@NonNull DataSnapshot receiver)

Returns the content of the DataSnapshot converted to a POJO.

Supports generics like List<> or Map<>. Use @JvmSuppressWildcards to force the compiler to use the type T, and not ? extends T.

Deprecation Notice: The Kotlin extensions (KTX) APIs have been added to their respective main modules, and the Kotlin extension (KTX) APIs in com.google.firebase.firebase-database-ktx are now deprecated. As early as April 2024, we'll no longer release KTX modules. For details, see the FAQ about this initiative.

DatabaseKt.getValue

public static final T <T extends Object> DatabaseKt.getValue(@NonNull MutableData receiver)

Returns the content of the MutableData converted to a POJO.

Supports generics like List<> or Map<>. Use @JvmSuppressWildcards to force the compiler to use the type T, and not ? extends T.

Deprecation Notice: The Kotlin extensions (KTX) APIs have been added to their respective main modules, and the Kotlin extension (KTX) APIs in com.google.firebase.firebase-database-ktx are now deprecated. As early as April 2024, we'll no longer release KTX modules. For details, see the FAQ about this initiative.

DatabaseKt.values

public static final @NonNull Flow<T> <T extends Object> DatabaseKt.values(@NonNull Query receiver)

Starts listening to this query and emits its values converted to a POJO via a Flow.

  • When the returned flow starts being collected, a ValueEventListener will be attached.

  • When the flow completes, the listener will be removed.

Deprecation Notice: The Kotlin extensions (KTX) APIs have been added to their respective main modules, and the Kotlin extension (KTX) APIs in com.google.firebase.firebase-database-ktx are now deprecated. As early as April 2024, we'll no longer release KTX modules. For details, see the FAQ about this initiative.