-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(database)!: rework as part of #6979 #7202
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
2 similar comments
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
d415cfd
to
2df0b92
Compare
This comment has been minimized.
This comment has been minimized.
* refactor(database): rename reference() to ref([String? path]) BREAKING CHANGE: this rename and signature change is required to have a symmetric interface with web RTDB SDK * test(database): test ref() * test(database): use ref(path) instead of ref().child(path) * fix(database): re-create firebase app for testing * chore(database): move reference back and deprectae
2df0b92
to
219a737
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Co-authored-by: ehesp <[email protected]> Co-authored-by: Andrei Lesnitsky <[email protected]> Co-authored-by: Elliot Hesp <[email protected]> Co-authored-by: russellwheatley <[email protected]>
Co-authored-by: ehesp <[email protected]> Co-authored-by: Andrei Lesnitsky <[email protected]> Co-authored-by: Elliot Hesp <[email protected]> Co-authored-by: russellwheatley <[email protected]>
Description
Realtime Database has been fully reworked to bring the plugin inline with the federated plugin
setup, a more familiar API, better documentation and many more unit and end-to-end tests.
General
Fixed an issue where providing a
Map
withint
keys would crash.FirebaseDatabase
DEPRECATED:
FirebaseDatabase()
has now been deprecated in favor ofFirebaseDatabase.instanceFor()
.DEPRECATED:
reference()
has now been deprecated in favor ofref()
.NEW: Added support for
ref()
, which allows you to provide an optional path to any database node rather than callingchild()
.NEW: Add emulator support via
useDatabaseEmulator()
.NEW: Add support for
refFromURL()
.BREAKING:
setPersistenceEnabled()
is now synchronous.BREAKING:
setPersistenceCacheSizeBytes()
is now synchronous.BREAKING:
setLoggingEnabled()
is now synchronous.DatabaseReference
BREAKING:
parent
is now a getter (inline with the JavaScript API).BREAKING:
root
is now a getter (inline with the JavaScript API).BREAKING:
set()
now accepts anObject?
value (rather thandynamic
) and no longer accepts a priority.NEW: Added support for
setWithPriority()
.NEW: Added support for locally applying transaction results via the
applyLocally
property onrunTransaction
.Query
NEW:
once()
now accepts an optionalDatabaseEventType
(rather than just subscribing to the value).BREAKING:
limitToFirst()
now asserts the value is positive.BREAKING:
limitToLast()
now asserts the value is positive.OnDisconnect
set()
now accepts anObject?
value (rather thandynamic
) and no longer accepts a priority.setWithPriority()
.Event
BREAKING: The
Event
class returned from database queries has been renamed toDatabaseEvent
.NEW:
DatabaseEvent
(oldEvent
)The
DatabaseEventType
is now returned on the event.The
previousChildKey
is now returned on the event (previously calledpreviousSiblingKey
).NEW:
DatabaseEventType
A
DatabaseEventType
is now returned from aDatabaseEvent
.DataSnapshot
NEW: Added support for accessing the priority via the
.priority
getter.NEW: Added support for determining whether the snapshot has a child via
hasChild()
.NEW: Added support for accessing a snapshot child node via
child()
.NEW: Added support for iterating the child nodes of the snapshot via the
.children
getter.snapshot.value
are no longer pre-sorted when using order queries, use.children
if you need to iterate over your value keys in order.
TransactionResult
BREAKING: The result of a transaction no longer returns a
DatabaseError
, instead handle errors of a transaction via aFuture
completion error.NEW:
Transaction
Transaction.success(value)
return this from inside yourTransactionHandler
to indicate a successful execution.Transaction.abort()
return this from inside yourTransactionHandler
to indicate that the transaction should be aborted.TransactionHandler
Transaction
either viaTransaction.success()
orTransaction.abort()
.DatabaseError
BREAKING: The
DatabaseError
class has been removed. Errors are now returned as aFirebaseException
inline with the other plugins.Related Issues
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
).This will ensure a smooth and quick review process. Updating the
pubspec.yaml
and changelogs is not required.///
).melos run analyze
) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?