我正在运行这个简单的代码
db.query(SampleType).run().toList();
我得到一个错误。当我查询某些类型时,我没有收到错误,而其他类型则有。看来我已经填充了数据库并更新了我的类型,现在一些查询无法解码。我没有尝试使用过滤器,但是如果我使用查找某个已知实体它会起作用,但是我使用此命令SampleType
从我的数据库中删除所有 s,但现在我遇到了一些不希望的损坏实体。如何手动擦除数据库?对于初学者,本地数据库实际上驻留在哪里?
这是实际的错误
Bad state: Error while decoding entity (Illegal argument(s): The type argument must not be null., #0 Key.Key (package:gcloud/src/db/models.dart:22:7)
#1 Key.append (package:gcloud/src/db/models.dart:55:16)
#2 ModelDBImpl.fromDatastoreKey (package:gcloud/src/db/model_db_impl.dart:65:23)
#3 ModelKeyProperty.decodePrimitiveValue (package:gcloud/src/db/annotations.dart:179:31)
#4 ListProperty.decodePrimitiveValue (package:gcloud/src/db/annotations.dart:268:65)
#5 _ModelDescription._decodeProperty (package:gcloud/src/db/model_db_impl.dart:427:42)
#6 _ModelDescription.decodeEntity. (package:gcloud/src/db/model_db_impl.dart:416:22)
#7 _HashMap&&_LinkedHashMapMixin.forEach (dart:collection-patch/collection_patch.dart:967)
#8 _ModelDescription.decodeEntity (package:gcloud/src/db/model_db_impl.dart:415:41)
#9 fromDatastoreEntity (package:gcloud/src/db/model_db_impl.dart:124:43)
#10 _MapStream._handleData (dart:async/stream_pipe.dart:233)
#11 _handleData (dart:async/stream_pipe.dart:170)
#12 _rootRunUnary (dart:async/zone.dart:899)
#13 _CustomZone.runUnary (dart:async/zone.dart:801)
#14 _CustomZone.runUnaryGuarded (dart:async/zone.dart:709)
#15 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341)
#16 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:270)
#17 _StreamController&&_SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:587)
#18 _StreamController._add (dart:async/stream_controller.dart:462)
#19 add (dart:async/stream_controller.dart:410)
#20 List.forEach (dart:core-patch/growable_array.dart:254)
#21 _handlePage (package:gcloud/common.dart:58:23)
#22 _rootRunUnary (dart:async/zone.dart:899)
#23 _CustomZone.runUnary (dart:async/zone.dart:801)
#24 _Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:496)
#25 _Future._propagateToListeners (dart:async/future_impl.dart:579)
#26 _Future._complete (dart:async/future_impl.dart:325)
#27 Stream.fold. (dart:async/stream.dart:541)
#28 _rootRun (dart:async/zone.dart:888)
#29 _CustomZone.run (dart:async/zone.dart:793)
#30 _CustomZone.runGuarded (dart:async/zone.dart:701)
#31 _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:390)
#32 _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:399)
#33 _BufferingStreamSubscription._close (dart:async/stream_impl.dart:290)
#34 _ForwardingStream._handleDone (dart:async/stream_pipe.dart:110)
#35 _handleDone (dart:async/stream_pipe.dart:178)
#36 _rootRun (dart:async/zone.dart:888)
#37 _CustomZone.run (dart:async/zone.dart:793)
#38 _CustomZone.runGuarded (dart:async/zone.dart:701)
#39 _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:390)
#40 _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:399)
#41 _DelayedDone.perform (dart:async/stream_impl.dart:614)
#42 _StreamImplEvents.handleNext (dart:async/stream_impl.dart:711)
#43 _PendingEvents.schedule. (dart:async/stream_impl.dart:671)
#44 _rootRun (dart:async/zone.dart:888)
#45 _CustomZone.run (dart:async/zone.dart:793)
#46 _CustomZone.runGuarded (dart:async/zone.dart:701)
#47 _CustomZone.bindCallback. (dart:async/zone.dart:726)
#48 _rootRun (dart:async/zone.dart:892)
#49 _CustomZone.run (dart:async/zone.dart:793)
#50 _CustomZone.runGuarded (dart:async/zone.dart:701)
#51 _CustomZone.bindCallback. (dart:async/zone.dart:726)
#52 _asyncRunCallbackLoop (dart:async/schedule_microtask.dart:41)
#53 _asyncRunCallback (dart:async/schedule_microtask.dart:48)
#54 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:84)
#55 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:131)
).
package:gcloud/src/db/model_db_impl.dart 126:7 fromDatastoreEntity
dart:core List.forEach
package:gcloud/common.dart 58:23 _handlePage
dart:isolate _RawReceivePortImpl._handleMessage
#7 _HashMap&&_LinkedHashMapMixin.forEach (dart:collection-patch/collection_patch.dart:967)
#8 _ModelDescription.decodeEntity (package:gcloud/src/db/model_db_impl.dart:415:41)
#9 fromDatastoreEntity (package:gcloud/src/db/model_db_impl.dart:124:43)
#10 _MapStream._handleData (dart:async/stream_pipe.dart:233)
#11 _handleData (dart:async/stream_pipe.dart:170)
#12 _rootRunUnary (dart:async/zone.dart:899)
#13 _CustomZone.runUnary (dart:async/zone.dart:801)
#14 _CustomZone.runUnaryGuarded (dart:async/zone.dart:709)
#15 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341)
#16 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:270)
#17 _StreamController&&_SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:587)
#18 _StreamController._add (dart:async/stream_controller.dart:462)
#19 add (dart:async/stream_controller.dart:410)
#20 List.forEach (dart:core-patch/growable_array.dart:254)
#21 _handlePage (package:gcloud/common.dart:58:23)
#22 _rootRunUnary (dart:async/zone.dart:899)
#23 _CustomZone.runUnary (dart:async/zone.dart:801)
#24 _Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:496)
#25 _Future._propagateToListeners (dart:async/future_impl.dart:579)
#26 _Future._complete (dart:async/future_impl.dart:325)
#27 Stream.fold. (dart:async/stream.dart:541)
#28 _rootRun (dart:async/zone.dart:888)
#29 _CustomZone.run (dart:async/zone.dart:793)
#30 _CustomZone.runGuarded (dart:async/zone.dart:701)
#31 _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:390)
#32 _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:399)
#33 _BufferingStreamSubscription._close (dart:async/stream_impl.dart:290)
#34 _ForwardingStream._handleDone (dart:async/stream_pipe.dart:110)
#35 _handleDone (dart:async/stream_pipe.dart:178)
#36 _rootRun (dart:async/zone.dart:888)
#37 _CustomZone.run (dart:async/zone.dart:793)
#38 _CustomZone.runGuarded (dart:async/zone.dart:701)
#39 _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:390)
#40 _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:399)
#41 _DelayedDone.perform (dart:async/stream_impl.dart:614)
#42 _StreamImplEvents.handleNext (dart:async/stream_impl.dart:711)
#43 _PendingEvents.schedule. (dart:async/stream_impl.dart:671)
#44 _rootRun (dart:async/zone.dart:888)
#45 _CustomZone.run (dart:async/zone.dart:793)
#46 _CustomZone.runGuarded (dart:async/zone.dart:701)
#47 _CustomZone.bindCallback. (dart:async/zone.dart:726)
#48 _rootRun (dart:async/zone.dart:892)
#49 _CustomZone.run (dart:async/zone.dart:793)
#50 _CustomZone.runGuarded (dart:async/zone.dart:701)
#51 _CustomZone.bindCallback. (dart:async/zone.dart:726)
#52 _asyncRunCallbackLoop (dart:async/schedule_microtask.dart:41)
#53 _asyncRunCallback (dart:async/schedule_microtask.dart:48)
#54 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:84)
#55 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:131)
).
package:gcloud/src/db/model_db_impl.dart 126:7 fromDatastoreEntity
dart:core List.forEach
package:gcloud/common.dart 58:23 _handlePage
dart:isolate _RawReceivePortImpl._handleMessage
#28 _rootRun (dart:async/zone.dart:888)
#29 _CustomZone.run (dart:async/zone.dart:793)
#30 _CustomZone.runGuarded (dart:async/zone.dart:701)
#31 _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:390)
#32 _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:399)
#33 _BufferingStreamSubscription._close (dart:async/stream_impl.dart:290)
#34 _ForwardingStream._handleDone (dart:async/stream_pipe.dart:110)
#35 _handleDone (dart:async/stream_pipe.dart:178)
#36 _rootRun (dart:async/zone.dart:888)
#37 _CustomZone.run (dart:async/zone.dart:793)
#38 _CustomZone.runGuarded (dart:async/zone.dart:701)
#39 _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:390)
#40 _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:399)
#41 _DelayedDone.perform (dart:async/stream_impl.dart:614)
#42 _StreamImplEvents.handleNext (dart:async/stream_impl.dart:711)
#43 _PendingEvents.schedule. (dart:async/stream_impl.dart:671)
#44 _rootRun (dart:async/zone.dart:888)
#45 _CustomZone.run (dart:async/zone.dart:793)
#46 _CustomZone.runGuarded (dart:async/zone.dart:701)
#47 _CustomZone.bindCallback. (dart:async/zone.dart:726)
#48 _rootRun (dart:async/zone.dart:892)
#49 _CustomZone.run (dart:async/zone.dart:793)
#50 _CustomZone.runGuarded (dart:async/zone.dart:701)
#51 _CustomZone.bindCallback. (dart:async/zone.dart:726)
#52 _asyncRunCallbackLoop (dart:async/schedule_microtask.dart:41)
#53 _asyncRunCallback (dart:async/schedule_microtask.dart:48)
#54 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:84)
#55 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:131)
).
package:gcloud/src/db/model_db_impl.dart 126:7 fromDatastoreEntity
dart:core List.forEach
package:gcloud/common.dart 58:23 _handlePage
dart:isolate _RawReceivePortImpl._handleMessage
#44 _rootRun (dart:async/zone.dart:888)
#45 _CustomZone.run (dart:async/zone.dart:793)
#46 _CustomZone.runGuarded (dart:async/zone.dart:701)
#47 _CustomZone.bindCallback. (dart:async/zone.dart:726)
#48 _rootRun (dart:async/zone.dart:892)
#49 _CustomZone.run (dart:async/zone.dart:793)
#50 _CustomZone.runGuarded (dart:async/zone.dart:701)
#51 _CustomZone.bindCallback. (dart:async/zone.dart:726)
#52 _asyncRunCallbackLoop (dart:async/schedule_microtask.dart:41)
#53 _asyncRunCallback (dart:async/schedule_microtask.dart:48)
#54 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:84)
#55 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:131)
).
package:gcloud/src/db/model_db_impl.dart 126:7 fromDatastoreEntity
dart:core List.forEach
package:gcloud/common.dart 58:23 _handlePage
dart:isolate _RawReceivePortImpl._handleMessage
#48 _rootRun (dart:async/zone.dart:892)
#49 _CustomZone.run (dart:async/zone.dart:793)
#50 _CustomZone.runGuarded (dart:async/zone.dart:701)
#51 _CustomZone.bindCallback. (dart:async/zone.dart:726)
#52 _asyncRunCallbackLoop (dart:async/schedule_microtask.dart:41)
#53 _asyncRunCallback (dart:async/schedule_microtask.dart:48)
#54 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:84)
#55 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:131)
).
package:gcloud/src/db/model_db_impl.dart 126:7 fromDatastoreEntity
dart:core List.forEach
package:gcloud/common.dart 58:23 _handlePage
dart:isolate _RawReceivePortImpl._handleMessage
#52 _asyncRunCallbackLoop (dart:async/schedule_microtask.dart:41)
#53 _asyncRunCallback (dart:async/schedule_microtask.dart:48)
#54 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:84)
#55 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:131)
).
package:gcloud/src/db/model_db_impl.dart 126:7 fromDatastoreEntity
dart:core List.forEach
package:gcloud/common.dart 58:23 _handlePage
dart:isolate _RawReceivePortImpl._handleMessage