1
我運行這個簡單的代碼如何手動刪除本地gcloud Dart DB?
db.query(SampleType).run().toList();
,我得到一個錯誤。當我查詢某些類型時,我沒有遇到錯誤,但是我有其他類型的錯誤。看起來我已經填充了數據庫並更新了我的類型,現在一些查詢不會解碼。我沒有嘗試使用過濾器,但是如果我使用查找某個已知實體,它將起作用,但是我使用此命令從我的數據庫中清除所有SampleType
,但現在我陷入了一些不受歡迎的受損實體。我如何手動清除數據庫?對於初學者來說,實際上Local DB在哪裏?
下面是實際工作中的錯誤
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
我發現http:// localhost:8000/datastore db管理路由非常有用! – 2014-12-05 20:31:09
'--clear-datastore'沒有做你需要的東西? – 2014-12-05 21:41:06