Realtime Database · Kotlin Compatibility
This page tracks an integration contract: unchanged Firebase code run through a Pyric runtime seam, so there is no separate Firebase public API to measure. The rows below are its signed behavior inventory.
Integration compatibility ledger for the Pure-Kotlin Realtime Database client (packages/kt-client), conforming to com.google.firebase:firebase-database via Pyric WebSocket bridge transport.
Database Instance & Connection
FirebaseDatabase.getInstance() / Firebase.databaseReturns the default FirebaseDatabase instance bound to the active bridge connection.
com.google.firebase:firebase-database specification. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#instance-default.FirebaseDatabase.getInstance(url) / Firebase.database(url)Returns a distinct FirebaseDatabase handle for each database URL; production isolates the data and rules of each URL's database.
com.google.firebase:firebase-database specification. The test asserts a distinct handle and URL per instance; bridge operations carry no instance field. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#instance-url.each URL yields a distinct handle, but data and rules are not isolated: the bridge does not carry the instance, so every handle reaches the default database
FirebaseDatabase.referenceReturns a DatabaseReference pointing to the root of the Realtime Database.
com.google.firebase:firebase-database specification. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#ref-root.FirebaseDatabase.getReference(path)Returns a DatabaseReference pointing to the specified slash-delimited path.
com.google.firebase:firebase-database specification. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#ref-path.FirebaseDatabase.goOffline() / goOnline()Suspends and resumes the Realtime Database connection to the Pyric worker. goOffline() also turns .info/connected false until goOnline().
com.google.firebase:firebase-database specification. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#connection-toggle.getReference(".info/connected") with a value listenerServed by the client from its bridge connection. It reports false until the client attaches and false whenever the connection is interrupted, closed or taken offline with goOffline(), and true once the client re-attaches. An onDisconnect registered when it turns true reaches the host on the new connection, after the restore.
com.google.firebase:firebase-database specification; ADR-0019 amendment "every client serves
.info locally". No .info listener or read reaches the host. Reconnect tests: InfoConnectedReconnectTest.kt pins false, true, false, true across a drop with no repeated value, and a presence re-arm from the true callback sent on the new socket after the replayed listeners, the held operation and, on a replaced host, the Auth restore. Test: packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#info-connected.getReference(".info") / getReference(".info/serverTimeOffset")Served locally: .info is { connected, serverTimeOffset }, serverTimeOffset is 0, and any other path under .info is null.
com.google.firebase:firebase-database specification. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#info-root-offset.the offset is always 0: the bridge handshake carries no server timestamp, and production delivers no offset until its first handshake; Android's
.info/authenticated is not servedDatabaseReference Navigation & Properties
DatabaseReference.child(path)Returns a child DatabaseReference relative to the current path.
com.google.firebase:firebase-database specification. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#ref-child.DatabaseReference.parentReturns the parent DatabaseReference, or null when called on the root reference.
com.google.firebase:firebase-database specification. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#ref-parent.DatabaseReference.rootReturns the root DatabaseReference from any descendant reference.
com.google.firebase:firebase-database specification. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#ref-root-prop.DatabaseReference.keyReturns the last path segment token of the reference, or null for the root reference.
com.google.firebase:firebase-database specification. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#ref-key.DatabaseReference.pathReturns the normalized slash-delimited full path of the reference.
com.google.firebase:firebase-database specification. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#ref-path-prop.DatabaseReference.push()Generates a new child DatabaseReference with a chronologically ordered unique push ID.
com.google.firebase:firebase-database specification. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#ref-push.DatabaseReference.push().keyMonotonically orders generated push keys lexicographically by creation timestamp.
com.google.firebase:firebase-database specification. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#ref-push-key-ordering.Write Operations
DatabaseReference.setValue(value)Overwrites data at the reference path with the provided value.
com.google.firebase:firebase-database specification. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#write-set.DatabaseReference.setValue(null)Deletes data at the reference path when setValue is called with null.
com.google.firebase:firebase-database specification. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#write-set-null.DatabaseReference.setPriority(priority)Updates the ordering priority metadata of the node without altering its value.
com.google.firebase:firebase-database specification. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#write-set-priority.DatabaseReference.setValue(value, priority)Atomically writes the node value alongside its ordering priority metadata.
com.google.firebase:firebase-database specification. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#write-set-with-priority.DatabaseReference.updateChildren(update)Performs a multi-path atomic update of specified child keys without overwriting omitted siblings.
com.google.firebase:firebase-database specification. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#write-update.DatabaseReference.removeValue()Removes the node and all descendant data at the reference path.
com.google.firebase:firebase-database specification. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#write-remove.ServerValue Sentinels
ServerValue.TIMESTAMPResolves server-side timestamp sentinel into current epoch milliseconds upon write.
com.google.firebase:firebase-database specification. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#sentinel-timestamp.ServerValue.increment(delta)Atomically increments the numeric value at the target path by delta on the server.
com.google.firebase:firebase-database specification. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#sentinel-increment.One-Shot Reads & DataSnapshot Inspection
DatabaseReference.get()Fetches a one-shot DataSnapshot of the current data at the reference path.
com.google.firebase:firebase-database specification. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#read-get.DataSnapshot.exists()Returns true if the DataSnapshot contains non-null data.
com.google.firebase:firebase-database specification. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#snap-exists.DataSnapshot.keyReturns the key name of the location that generated the DataSnapshot.
com.google.firebase:firebase-database specification. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#snap-key.DataSnapshot.value / getValue()Returns the deserialized Kotlin value (Map, List, String, Number, Boolean, or null) of the snapshot.
com.google.firebase:firebase-database specification. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#snap-value.DataSnapshot.childrenReturns an iterable of child DataSnapshots ordered according to the active query.
com.google.firebase:firebase-database specification. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#snap-children.DataSnapshot.child(path)Returns a DataSnapshot for the relative descendant path within the snapshot.
com.google.firebase:firebase-database specification. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#snap-child-path.DataSnapshot.priorityReturns the priority value (String, Number, or null) associated with the snapshot node.
com.google.firebase:firebase-database specification. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#snap-priority.Realtime Listeners & Streams
Query.snapshots / addValueEventListenerEmits DataSnapshot initially and upon any data change at the path via Kotlin Flow or listener.
com.google.firebase:firebase-database specification. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#listen-value.Query.childEvents / onChildAddedEmits ChildEvent.Added for each existing child and whenever a new child is added.
com.google.firebase:firebase-database specification. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#listen-child-added.Query.childEvents / onChildChangedEmits ChildEvent.Changed whenever an existing child node is modified.
com.google.firebase:firebase-database specification. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#listen-child-changed.Query.childEvents / onChildRemovedEmits ChildEvent.Removed whenever a child node is removed from the watched location.
com.google.firebase:firebase-database specification. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#listen-child-removed.Query.removeEventListener / Job.cancel()Cancels the active listener or coroutine Flow collection and unsubscribes the worker listener.
com.google.firebase:firebase-database specification. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#listen-cancel.Query Ordering, Filtering & Limits
Query.orderByChild(path)Orders query results by the value of the specified nested child key.
com.google.firebase:firebase-database specification. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#query-order-by-child.Query.orderByKey()Orders query results lexicographically by child key name.
com.google.firebase:firebase-database specification. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#query-order-by-key.Query.orderByValue()Orders query results by direct scalar node values.
com.google.firebase:firebase-database specification. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#query-order-by-value.Query.equalTo(value, key)Filters query results to nodes matching the exact sort value and optional key.
com.google.firebase:firebase-database specification. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#query-equal-to.Query.startAt(value) / endAt(value)Restricts query results to the inclusive lower and upper boundary values.
com.google.firebase:firebase-database specification. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#query-range.Query.limitToFirst(limit) / limitToLast(limit)Caps query results to the first N or last N ordered child nodes.
com.google.firebase:firebase-database specification. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#query-limit.Transactions & OnDisconnect
DatabaseReference.runTransaction(handler)Executes optimistic concurrency transaction handler on MutableData and commits upon success.
com.google.firebase:firebase-database specification. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#tx-run.Transaction.abort()Aborts an in-progress transaction without writing changes to the database.
com.google.firebase:firebase-database specification. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#tx-abort.OnDisconnect.setValue(value) / removeValue()Registers server-side write or removal operations to execute upon client disconnect.
com.google.firebase:firebase-database specification. The Node host runs the operations when the client socket closes, by a close frame or after the host closes a socket that pinged and went silent, and keeps the session signed in for re-attach (ADR-0019):
packages/cli/test/serve/fixtures/hosted-sqlite-relay-ondisconnect.ts. The app scenario test/apps/host-closes-silent-consumer sends the same rtdb.onDisconnectSet from a paused node --import @pyric/cli/register process on a real dev server, and the host runs it once the liveness window passes. Test: packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#ondisconnect-set-remove.OnDisconnect.cancel()Cancels previously queued OnDisconnect operations at the reference path.
com.google.firebase:firebase-database specification. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#ondisconnect-cancel.Current gaps
Documented divergences
Known differences between Pyric and production Firebase. Each remains tracked as a non-conforming row.
FirebaseDatabase.getInstance(url) / Firebase.database(url)Returns a distinct FirebaseDatabase handle for each database URL; production isolates the data and rules of each URL's database.
com.google.firebase:firebase-database specification. The test asserts a distinct handle and URL per instance; bridge operations carry no instance field. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#instance-url.getReference(".info") / getReference(".info/serverTimeOffset")Served locally: .info is { connected, serverTimeOffset }, serverTimeOffset is 0, and any other path under .info is null.
com.google.firebase:firebase-database specification. Test:
packages/kt-client/src/test/kotlin/dev/pyric/database/RtdbConformanceTest.kt assertion set rtdb-kotlin#info-root-offset.