OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 /// This library provides a low-level API for accessing Google's Cloud | 5 /// This library provides a low-level API for accessing Google's Cloud |
6 /// Datastore. | 6 /// Datastore. |
7 /// | 7 /// |
8 /// For more information on Cloud Datastore, please refer to the following | 8 /// For more information on Cloud Datastore, please refer to the following |
9 /// developers page: https://cloud.google.com/datastore/docs | 9 /// developers page: https://cloud.google.com/datastore/docs |
10 library gcloud.datastore; | 10 library gcloud.datastore; |
11 | 11 |
12 import 'dart:async'; | 12 import 'dart:async'; |
13 | 13 |
14 import 'common.dart' show Page; | 14 import 'common.dart' show Page; |
15 import 'service_scope.dart' as ss; | 15 import 'service_scope.dart' as ss; |
16 | 16 |
17 const Symbol _datastoreKey = #_gcloud.datastore; | 17 const Symbol _datastoreKey = #_gcloud.datastore; |
18 | 18 |
19 /// Access the [Datastore] object available in the current service scope. | 19 /// Access the [Datastore] object available in the current service scope. |
20 /// | 20 /// |
21 /// The returned object will be the one which was previously registered with | 21 /// The returned object will be the one which was previously registered with |
22 /// [registerDatastoreService] within the current (or a parent) service scope. | 22 /// [registerDatastoreService] within the current (or a parent) service scope. |
23 /// | 23 /// |
24 /// Accessing this getter outside of a service scope will result in an error. | 24 /// Accessing this getter outside of a service scope will result in an error. |
| 25 /// See the `package:gcloud/service_scope.dart` library for more information. |
25 Datastore get datastoreService => ss.lookup(_datastoreKey); | 26 Datastore get datastoreService => ss.lookup(_datastoreKey); |
26 | 27 |
27 /// Registers the [Datastore] object within the current service scope. | 28 /// Registers the [Datastore] object within the current service scope. |
28 /// | 29 /// |
29 /// The provided `datastore` object will be avilable via the top-level | 30 /// The provided `datastore` object will be avilable via the top-level |
30 /// `datastore` getter. | 31 /// `datastore` getter. |
31 /// | 32 /// |
32 /// Calling this function outside of a service scope will result in an error. | 33 /// Calling this function outside of a service scope will result in an error. |
33 /// Calling this function more than once inside the same service scope is not | 34 /// Calling this function more than once inside the same service scope is not |
34 /// allowed. | 35 /// allowed. |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 /// If a [transaction] is given, the query will be within this transaction. | 411 /// If a [transaction] is given, the query will be within this transaction. |
411 /// But note that arbitrary queries within a transaction are not possible. | 412 /// But note that arbitrary queries within a transaction are not possible. |
412 /// A transaction is limited to a very small number of entity groups. Usually | 413 /// A transaction is limited to a very small number of entity groups. Usually |
413 /// queries with transactions are restricted by providing an ancestor filter. | 414 /// queries with transactions are restricted by providing an ancestor filter. |
414 /// | 415 /// |
415 /// Outside of transactions, the result set might be stale. Queries are by | 416 /// Outside of transactions, the result set might be stale. Queries are by |
416 /// default eventually consistent. | 417 /// default eventually consistent. |
417 Future<Page<Entity>> query( | 418 Future<Page<Entity>> query( |
418 Query query, {Partition partition, Transaction transaction}); | 419 Query query, {Partition partition, Transaction transaction}); |
419 } | 420 } |
OLD | NEW |