google-cloud-datastore 1.7.2 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +2 -1
- data/CHANGELOG.md +47 -0
- data/TROUBLESHOOTING.md +2 -8
- data/lib/google-cloud-datastore.rb +12 -18
- data/lib/google/cloud/datastore.rb +12 -11
- data/lib/google/cloud/datastore/commit.rb +4 -4
- data/lib/google/cloud/datastore/convert.rb +4 -4
- data/lib/google/cloud/datastore/credentials.rb +2 -2
- data/lib/google/cloud/datastore/entity.rb +3 -3
- data/lib/google/cloud/datastore/gql_query.rb +5 -5
- data/lib/google/cloud/datastore/key.rb +5 -5
- data/lib/google/cloud/datastore/properties.rb +1 -1
- data/lib/google/cloud/datastore/query.rb +12 -12
- data/lib/google/cloud/datastore/service.rb +31 -86
- data/lib/google/cloud/datastore/version.rb +1 -1
- metadata +10 -65
- data/lib/google/cloud/datastore/v1.rb +0 -16
- data/lib/google/cloud/datastore/v1/credentials.rb +0 -39
- data/lib/google/cloud/datastore/v1/datastore_client.rb +0 -574
- data/lib/google/cloud/datastore/v1/datastore_client_config.json +0 -61
- data/lib/google/cloud/datastore/v1/doc/google/datastore/v1/datastore.rb +0 -283
- data/lib/google/cloud/datastore/v1/doc/google/datastore/v1/entity.rb +0 -189
- data/lib/google/cloud/datastore/v1/doc/google/datastore/v1/query.rb +0 -297
- data/lib/google/cloud/datastore/v1/doc/google/protobuf/struct.rb +0 -74
- data/lib/google/cloud/datastore/v1/doc/google/protobuf/timestamp.rb +0 -109
- data/lib/google/cloud/datastore/v1/doc/google/protobuf/wrappers.rb +0 -26
- data/lib/google/cloud/datastore/v1/doc/google/type/latlng.rb +0 -65
- data/lib/google/datastore/v1/datastore_pb.rb +0 -147
- data/lib/google/datastore/v1/datastore_services_pb.rb +0 -65
- data/lib/google/datastore/v1/entity_pb.rb +0 -64
- data/lib/google/datastore/v1/query_pb.rb +0 -132
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 826035219f59542e1883c4bd94ae39ecd846bf15d5449a3494553fdf3f97b1b3
|
4
|
+
data.tar.gz: 4896e0241e4853b98c58ad176fc8d7497c6e48e57ef621227c6feeeadcdd8002
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 462c9cea295f6f9c162b69f4b4494bd681928c5970a96eb1de89896535f732de81150fe2b3f7ef35a00396c7a917269c42e0fda6cdc70d974e984d309caf7dec
|
7
|
+
data.tar.gz: 4be0857cc53dab982c5542e04249b66bb2e6475666343623f778b1310e16f2de2f12861345dc2794289bd27beaf8e05269541f9b2f2c1f42f753a3113375a76e
|
data/AUTHENTICATION.md
CHANGED
@@ -76,7 +76,8 @@ The environment variables that google-cloud-datastore checks for project ID are:
|
|
76
76
|
1. `DATASTORE_PROJECT`
|
77
77
|
2. `GOOGLE_CLOUD_PROJECT`
|
78
78
|
|
79
|
-
The environment variables that google-cloud-datastore checks for credentials are configured on
|
79
|
+
The environment variables that google-cloud-datastore checks for credentials are configured on
|
80
|
+
{Google::Cloud::Datastore::Credentials}:
|
80
81
|
|
81
82
|
1. `DATASTORE_CREDENTIALS` - Path to JSON file, or JSON contents
|
82
83
|
2. `DATASTORE_KEYFILE` - Path to JSON file, or JSON contents
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,52 @@
|
|
1
1
|
# Release History
|
2
2
|
|
3
|
+
### 2.0.0 / 2020-08-06
|
4
|
+
|
5
|
+
This is a major update that removes the "low-level" client interface code, and
|
6
|
+
instead adds the new `google-cloud-datastore-v1` gem as a dependency.
|
7
|
+
The new dependency is a rewritten low-level client, produced by a next-
|
8
|
+
generation client code generator, with improved performance and stability.
|
9
|
+
|
10
|
+
This change should have no effect on the high-level interface that most users
|
11
|
+
will use. The one exception is that the (mostly undocumented) `client_config`
|
12
|
+
argument, for adjusting low-level parameters such as RPC retry settings on
|
13
|
+
client objects, has been removed. If you need to adjust these parameters, use
|
14
|
+
the configuration interface in `google-cloud-datastore-v1`.
|
15
|
+
|
16
|
+
Substantial changes have been made in the low-level interfaces, however. If you
|
17
|
+
are using the low-level classes under the `Google::Cloud::Datastore::V1` module,
|
18
|
+
please review the docs for the new `google-cloud-datastore-v1` gem. In
|
19
|
+
particular:
|
20
|
+
|
21
|
+
* Some classes have been renamed, notably the client class itself.
|
22
|
+
* The client constructor takes a configuration block instead of configuration
|
23
|
+
keyword arguments.
|
24
|
+
* All RPC method arguments are now keyword arguments.
|
25
|
+
|
26
|
+
### 1.8.2 / 2020-05-28
|
27
|
+
|
28
|
+
#### Documentation
|
29
|
+
|
30
|
+
* Fix a few broken links
|
31
|
+
|
32
|
+
### 1.8.1 / 2020-05-19
|
33
|
+
|
34
|
+
#### Bug Fixes
|
35
|
+
|
36
|
+
* Adjusted some default timeout and retry settings
|
37
|
+
|
38
|
+
### 1.8.0 / 2020-03-11
|
39
|
+
|
40
|
+
#### Features
|
41
|
+
|
42
|
+
* Support separate project setting for quota/billing
|
43
|
+
|
44
|
+
### 1.7.3 / 2020-01-23
|
45
|
+
|
46
|
+
#### Documentation
|
47
|
+
|
48
|
+
* Update copyright year
|
49
|
+
|
3
50
|
### 1.7.2 / 2019-12-12
|
4
51
|
|
5
52
|
#### Bug Fixes
|
data/TROUBLESHOOTING.md
CHANGED
@@ -24,14 +24,8 @@ improved, *please* create a new issue on GitHub so we can talk about it.
|
|
24
24
|
|
25
25
|
- [New issue][gh-ruby]
|
26
26
|
|
27
|
-
Or, you can ask questions on the [Google Cloud Platform Slack][slack-ruby]. You
|
28
|
-
can use the "ruby" channel for general Ruby questions, or use the
|
29
|
-
"google-cloud-ruby" channel if you have questions about this gem in particular.
|
30
|
-
|
31
27
|
[so-ruby]: http://stackoverflow.com/questions/tagged/google-cloud-platform+ruby+datastore
|
32
28
|
|
33
|
-
[gh-search-ruby]: https://github.com/
|
34
|
-
|
35
|
-
[gh-ruby]: https://github.com/googlecloudplatform/google-cloud-ruby/issues/new
|
29
|
+
[gh-search-ruby]: https://github.com/googleapis/google-cloud-ruby/issues?q=label%3A%22api%3A+datastore%22
|
36
30
|
|
37
|
-
[
|
31
|
+
[gh-ruby]: https://github.com/googleapis/google-cloud-ruby/issues/new
|
@@ -42,8 +42,6 @@ module Google
|
|
42
42
|
#
|
43
43
|
# * `https://www.googleapis.com/auth/datastore`
|
44
44
|
# @param [Integer] timeout Default timeout to use in requests. Optional.
|
45
|
-
# @param [Hash] client_config A hash of values to override the default
|
46
|
-
# behavior of the API client. See Google::Gax::CallSettings. Optional.
|
47
45
|
#
|
48
46
|
# @return [Google::Cloud::Datastore::Dataset]
|
49
47
|
#
|
@@ -69,10 +67,9 @@ module Google
|
|
69
67
|
# platform_scope = "https://www.googleapis.com/auth/cloud-platform"
|
70
68
|
# datastore = gcloud.datastore scope: platform_scope
|
71
69
|
#
|
72
|
-
def datastore scope: nil, timeout: nil
|
70
|
+
def datastore scope: nil, timeout: nil
|
73
71
|
Google::Cloud.datastore @project, @keyfile,
|
74
|
-
scope: scope, timeout: (timeout || @timeout)
|
75
|
-
client_config: client_config
|
72
|
+
scope: scope, timeout: (timeout || @timeout)
|
76
73
|
end
|
77
74
|
|
78
75
|
##
|
@@ -96,8 +93,6 @@ module Google
|
|
96
93
|
#
|
97
94
|
# * `https://www.googleapis.com/auth/datastore`
|
98
95
|
# @param [Integer] timeout Default timeout to use in requests. Optional.
|
99
|
-
# @param [Hash] client_config A hash of values to override the default
|
100
|
-
# behavior of the API client. See Google::Gax::CallSettings. Optional.
|
101
96
|
#
|
102
97
|
# @return [Google::Cloud::Datastore::Dataset]
|
103
98
|
#
|
@@ -117,12 +112,11 @@ module Google
|
|
117
112
|
# datastore.save task
|
118
113
|
#
|
119
114
|
def self.datastore project_id = nil, credentials = nil, scope: nil,
|
120
|
-
timeout: nil
|
115
|
+
timeout: nil
|
121
116
|
require "google/cloud/datastore"
|
122
117
|
Google::Cloud::Datastore.new project_id: project_id,
|
123
118
|
credentials: credentials,
|
124
|
-
scope: scope, timeout: timeout
|
125
|
-
client_config: client_config
|
119
|
+
scope: scope, timeout: timeout
|
126
120
|
end
|
127
121
|
end
|
128
122
|
end
|
@@ -141,17 +135,17 @@ Google::Cloud.configure.add_config! :datastore do |config|
|
|
141
135
|
default_emulator = Google::Cloud::Config.deferred do
|
142
136
|
ENV["DATASTORE_EMULATOR_HOST"]
|
143
137
|
end
|
138
|
+
default_scopes = [
|
139
|
+
"https://www.googleapis.com/auth/cloud-platform",
|
140
|
+
"https://www.googleapis.com/auth/datastore"
|
141
|
+
]
|
144
142
|
|
145
143
|
config.add_field! :project_id, default_project, match: String, allow_nil: true
|
146
144
|
config.add_alias! :project, :project_id
|
147
|
-
config.add_field! :credentials, default_creds,
|
148
|
-
match: [String, Hash, Google::Auth::Credentials],
|
149
|
-
allow_nil: true
|
145
|
+
config.add_field! :credentials, default_creds, match: [String, Hash, Google::Auth::Credentials], allow_nil: true
|
150
146
|
config.add_alias! :keyfile, :credentials
|
151
|
-
config.add_field! :scope,
|
147
|
+
config.add_field! :scope, default_scopes, match: [String, Array]
|
152
148
|
config.add_field! :timeout, nil, match: Integer
|
153
|
-
config.add_field! :
|
154
|
-
config.add_field! :
|
155
|
-
match: String, allow_nil: true
|
156
|
-
config.add_field! :endpoint, nil, match: String
|
149
|
+
config.add_field! :emulator_host, default_emulator, match: String, allow_nil: true
|
150
|
+
config.add_field! :endpoint, "datastore.googleapis.com", match: String
|
157
151
|
end
|
@@ -70,8 +70,6 @@ module Google
|
|
70
70
|
#
|
71
71
|
# * `https://www.googleapis.com/auth/datastore`
|
72
72
|
# @param [Integer] timeout Default timeout to use in requests. Optional.
|
73
|
-
# @param [Hash] client_config A hash of values to override the default
|
74
|
-
# behavior of the API client. See Google::Gax::CallSettings. Optional.
|
75
73
|
# @param [String] endpoint Override of the endpoint host name. Optional.
|
76
74
|
# If the param is nil, uses the default endpoint.
|
77
75
|
# @param [String] emulator_host Datastore emulator host. Optional.
|
@@ -99,13 +97,17 @@ module Google
|
|
99
97
|
#
|
100
98
|
# datastore.save task
|
101
99
|
#
|
102
|
-
def self.new project_id: nil,
|
103
|
-
|
104
|
-
|
100
|
+
def self.new project_id: nil,
|
101
|
+
credentials: nil,
|
102
|
+
scope: nil,
|
103
|
+
timeout: nil,
|
104
|
+
endpoint: nil,
|
105
|
+
emulator_host: nil,
|
106
|
+
project: nil,
|
107
|
+
keyfile: nil
|
105
108
|
project_id ||= (project || default_project_id)
|
106
109
|
scope ||= configure.scope
|
107
110
|
timeout ||= configure.timeout
|
108
|
-
client_config ||= configure.client_config
|
109
111
|
endpoint ||= configure.endpoint
|
110
112
|
emulator_host ||= configure.emulator_host
|
111
113
|
|
@@ -116,8 +118,7 @@ module Google
|
|
116
118
|
return Datastore::Dataset.new(
|
117
119
|
Datastore::Service.new(
|
118
120
|
project_id, :this_channel_is_insecure,
|
119
|
-
host: emulator_host, timeout: timeout
|
120
|
-
client_config: client_config
|
121
|
+
host: emulator_host, timeout: timeout
|
121
122
|
)
|
122
123
|
)
|
123
124
|
end
|
@@ -136,7 +137,7 @@ module Google
|
|
136
137
|
Datastore::Dataset.new(
|
137
138
|
Datastore::Service.new(
|
138
139
|
project_id, credentials,
|
139
|
-
host: endpoint, timeout: timeout
|
140
|
+
host: endpoint, timeout: timeout
|
140
141
|
)
|
141
142
|
)
|
142
143
|
end
|
@@ -158,8 +159,6 @@ module Google
|
|
158
159
|
# * `scope` - (String, Array<String>) The OAuth 2.0 scopes controlling
|
159
160
|
# the set of resources and operations that the connection can access.
|
160
161
|
# * `timeout` - (Integer) Default timeout to use in requests.
|
161
|
-
# * `client_config` - (Hash) A hash of values to override the default
|
162
|
-
# behavior of the API client.
|
163
162
|
# * `endpoint` - (String) Override of the endpoint host name, or `nil`
|
164
163
|
# to use the default endpoint.
|
165
164
|
# * `emulator_host` - (String) Host name of the emulator. Defaults to
|
@@ -191,4 +190,6 @@ module Google
|
|
191
190
|
end
|
192
191
|
end
|
193
192
|
end
|
193
|
+
## Legacy generated client namespace
|
194
|
+
Datastore = Cloud::Datastore unless const_defined? :Datastore
|
194
195
|
end
|
@@ -136,16 +136,16 @@ module Google
|
|
136
136
|
def mutations
|
137
137
|
mutations = []
|
138
138
|
mutations += @shared_upserts.map do |entity|
|
139
|
-
Google::Datastore::V1::Mutation.new upsert: entity.to_grpc
|
139
|
+
Google::Cloud::Datastore::V1::Mutation.new upsert: entity.to_grpc
|
140
140
|
end
|
141
141
|
mutations += @shared_inserts.map do |entity|
|
142
|
-
Google::Datastore::V1::Mutation.new insert: entity.to_grpc
|
142
|
+
Google::Cloud::Datastore::V1::Mutation.new insert: entity.to_grpc
|
143
143
|
end
|
144
144
|
mutations += @shared_updates.map do |entity|
|
145
|
-
Google::Datastore::V1::Mutation.new update: entity.to_grpc
|
145
|
+
Google::Cloud::Datastore::V1::Mutation.new update: entity.to_grpc
|
146
146
|
end
|
147
147
|
mutations += @shared_deletes.map do |key|
|
148
|
-
Google::Datastore::V1::Mutation.new delete: key.to_grpc
|
148
|
+
Google::Cloud::Datastore::V1::Mutation.new delete: key.to_grpc
|
149
149
|
end
|
150
150
|
mutations
|
151
151
|
end
|
@@ -77,7 +77,7 @@ module Google
|
|
77
77
|
end
|
78
78
|
|
79
79
|
##
|
80
|
-
# Gets an object from a Google::Datastore::V1::Value.
|
80
|
+
# Gets an object from a Google::Cloud::Datastore::V1::Value.
|
81
81
|
def self.from_value grpc_value
|
82
82
|
if grpc_value.value_type == :null_value
|
83
83
|
return nil
|
@@ -110,9 +110,9 @@ module Google
|
|
110
110
|
end
|
111
111
|
|
112
112
|
##
|
113
|
-
# Stores an object into a Google::Datastore::V1::Value.
|
113
|
+
# Stores an object into a Google::Cloud::Datastore::V1::Value.
|
114
114
|
def self.to_value value
|
115
|
-
v = Google::Datastore::V1::Value.new
|
115
|
+
v = Google::Cloud::Datastore::V1::Value.new
|
116
116
|
if NilClass === value
|
117
117
|
v.null_value = :NULL_VALUE
|
118
118
|
elsif TrueClass === value
|
@@ -133,7 +133,7 @@ module Google
|
|
133
133
|
elsif String === value
|
134
134
|
v.string_value = value
|
135
135
|
elsif Array === value
|
136
|
-
v.array_value = Google::Datastore::V1::ArrayValue.new(
|
136
|
+
v.array_value = Google::Cloud::Datastore::V1::ArrayValue.new(
|
137
137
|
values: value.map { |val| to_value val }
|
138
138
|
)
|
139
139
|
elsif value.respond_to? :to_time
|
@@ -14,7 +14,7 @@
|
|
14
14
|
|
15
15
|
|
16
16
|
require "googleauth"
|
17
|
-
require "google/cloud/datastore/v1/credentials"
|
17
|
+
require "google/cloud/datastore/v1/datastore/credentials"
|
18
18
|
|
19
19
|
module Google
|
20
20
|
module Cloud
|
@@ -38,7 +38,7 @@ module Google
|
|
38
38
|
#
|
39
39
|
# datastore.project_id #=> "my-todo-project"
|
40
40
|
#
|
41
|
-
class Credentials < Google::Cloud::Datastore::V1::Credentials
|
41
|
+
class Credentials < Google::Cloud::Datastore::V1::Datastore::Credentials
|
42
42
|
end
|
43
43
|
end
|
44
44
|
end
|
@@ -427,10 +427,10 @@ module Google
|
|
427
427
|
end
|
428
428
|
|
429
429
|
##
|
430
|
-
# @private Convert the Entity to a Google::Datastore::V1::Entity
|
430
|
+
# @private Convert the Entity to a Google::Cloud::Datastore::V1::Entity
|
431
431
|
# object.
|
432
432
|
def to_grpc
|
433
|
-
grpc = Google::Datastore::V1::Entity.new(
|
433
|
+
grpc = Google::Cloud::Datastore::V1::Entity.new(
|
434
434
|
properties: @properties.to_grpc
|
435
435
|
)
|
436
436
|
grpc.key = @key.to_grpc unless @key.nil?
|
@@ -439,7 +439,7 @@ module Google
|
|
439
439
|
end
|
440
440
|
|
441
441
|
##
|
442
|
-
# @private Create a new Entity from a Google::Datastore::V1::Key
|
442
|
+
# @private Create a new Entity from a Google::Cloud::Datastore::V1::Key
|
443
443
|
# object.
|
444
444
|
def self.from_grpc grpc
|
445
445
|
entity = Entity.new
|
@@ -49,7 +49,7 @@ module Google
|
|
49
49
|
# gql_query = Google::Cloud::Datastore::GqlQuery.new
|
50
50
|
#
|
51
51
|
def initialize
|
52
|
-
@grpc = Google::Datastore::V1::GqlQuery.new
|
52
|
+
@grpc = Google::Cloud::Datastore::V1::GqlQuery.new
|
53
53
|
end
|
54
54
|
|
55
55
|
##
|
@@ -159,12 +159,12 @@ module Google
|
|
159
159
|
new_named_bindings.map do |name, value|
|
160
160
|
if value.is_a? Google::Cloud::Datastore::Cursor
|
161
161
|
@grpc.named_bindings[name.to_s] = \
|
162
|
-
Google::Datastore::V1::GqlQueryParameter.new(
|
162
|
+
Google::Cloud::Datastore::V1::GqlQueryParameter.new(
|
163
163
|
cursor: value.to_grpc
|
164
164
|
)
|
165
165
|
else
|
166
166
|
@grpc.named_bindings[name.to_s] = \
|
167
|
-
Google::Datastore::V1::GqlQueryParameter.new(
|
167
|
+
Google::Cloud::Datastore::V1::GqlQueryParameter.new(
|
168
168
|
value: Convert.to_value(value)
|
169
169
|
)
|
170
170
|
end
|
@@ -210,12 +210,12 @@ module Google
|
|
210
210
|
new_positional_bindings.map do |value|
|
211
211
|
if value.is_a? Google::Cloud::Datastore::Cursor
|
212
212
|
@grpc.positional_bindings << \
|
213
|
-
Google::Datastore::V1::GqlQueryParameter.new(
|
213
|
+
Google::Cloud::Datastore::V1::GqlQueryParameter.new(
|
214
214
|
cursor: value.to_grpc
|
215
215
|
)
|
216
216
|
else
|
217
217
|
@grpc.positional_bindings << \
|
218
|
-
Google::Datastore::V1::GqlQueryParameter.new(
|
218
|
+
Google::Cloud::Datastore::V1::GqlQueryParameter.new(
|
219
219
|
value: Convert.to_value(value)
|
220
220
|
)
|
221
221
|
end
|
@@ -268,7 +268,7 @@ module Google
|
|
268
268
|
end
|
269
269
|
|
270
270
|
##
|
271
|
-
# @private Convert the Key to a Google::Datastore::V1::Key object.
|
271
|
+
# @private Convert the Key to a Google::Cloud::Datastore::V1::Key object.
|
272
272
|
def to_grpc
|
273
273
|
grpc_path = path.map do |pe_kind, pe_id_or_name|
|
274
274
|
path_args = { kind: pe_kind }
|
@@ -277,11 +277,11 @@ module Google
|
|
277
277
|
elsif pe_id_or_name.is_a? String
|
278
278
|
path_args[:name] = pe_id_or_name unless pe_id_or_name.empty?
|
279
279
|
end
|
280
|
-
Google::Datastore::V1::Key::PathElement.new path_args
|
280
|
+
Google::Cloud::Datastore::V1::Key::PathElement.new path_args
|
281
281
|
end
|
282
|
-
grpc = Google::Datastore::V1::Key.new path: grpc_path
|
282
|
+
grpc = Google::Cloud::Datastore::V1::Key.new path: grpc_path
|
283
283
|
if project || namespace
|
284
|
-
grpc.partition_id = Google::Datastore::V1::PartitionId.new(
|
284
|
+
grpc.partition_id = Google::Cloud::Datastore::V1::PartitionId.new(
|
285
285
|
project_id: project.to_s, namespace_id: namespace.to_s
|
286
286
|
)
|
287
287
|
end
|
@@ -289,7 +289,7 @@ module Google
|
|
289
289
|
end
|
290
290
|
|
291
291
|
##
|
292
|
-
# @private Create a new Key from a Google::Datastore::V1::Key
|
292
|
+
# @private Create a new Key from a Google::Cloud::Datastore::V1::Key
|
293
293
|
# object.
|
294
294
|
def self.from_grpc grpc
|
295
295
|
return nil if grpc.nil?
|
@@ -61,7 +61,7 @@ module Google
|
|
61
61
|
# query = Google::Cloud::Datastore::Query.new
|
62
62
|
#
|
63
63
|
def initialize
|
64
|
-
@grpc = Google::Datastore::V1::Query.new
|
64
|
+
@grpc = Google::Cloud::Datastore::V1::Query.new
|
65
65
|
end
|
66
66
|
|
67
67
|
##
|
@@ -83,7 +83,7 @@ module Google
|
|
83
83
|
#
|
84
84
|
def kind *kinds
|
85
85
|
kinds.each do |kind|
|
86
|
-
grpc_kind = Google::Datastore::V1::KindExpression.new(
|
86
|
+
grpc_kind = Google::Cloud::Datastore::V1::KindExpression.new(
|
87
87
|
name: kind
|
88
88
|
)
|
89
89
|
@grpc.kind << grpc_kind
|
@@ -177,15 +177,15 @@ module Google
|
|
177
177
|
# tasks = datastore.run query
|
178
178
|
#
|
179
179
|
def where name, operator, value
|
180
|
-
@grpc.filter ||= Google::Datastore::V1::Filter.new(
|
181
|
-
composite_filter: Google::Datastore::V1::CompositeFilter.new(
|
180
|
+
@grpc.filter ||= Google::Cloud::Datastore::V1::Filter.new(
|
181
|
+
composite_filter: Google::Cloud::Datastore::V1::CompositeFilter.new(
|
182
182
|
op: :AND
|
183
183
|
)
|
184
184
|
)
|
185
185
|
@grpc.filter.composite_filter.filters << \
|
186
|
-
Google::Datastore::V1::Filter.new(
|
187
|
-
property_filter: Google::Datastore::V1::PropertyFilter.new(
|
188
|
-
property: Google::Datastore::V1::PropertyReference.new(
|
186
|
+
Google::Cloud::Datastore::V1::Filter.new(
|
187
|
+
property_filter: Google::Cloud::Datastore::V1::PropertyFilter.new(
|
188
|
+
property: Google::Cloud::Datastore::V1::PropertyReference.new(
|
189
189
|
name: name
|
190
190
|
),
|
191
191
|
op: Convert.to_prop_filter_op(operator),
|
@@ -273,8 +273,8 @@ module Google
|
|
273
273
|
# tasks = datastore.run query
|
274
274
|
#
|
275
275
|
def order name, direction = :asc
|
276
|
-
@grpc.order << Google::Datastore::V1::PropertyOrder.new(
|
277
|
-
property: Google::Datastore::V1::PropertyReference.new(
|
276
|
+
@grpc.order << Google::Cloud::Datastore::V1::PropertyOrder.new(
|
277
|
+
property: Google::Cloud::Datastore::V1::PropertyReference.new(
|
278
278
|
name: name
|
279
279
|
),
|
280
280
|
direction: prop_order_direction(direction)
|
@@ -384,8 +384,8 @@ module Google
|
|
384
384
|
#
|
385
385
|
def select *names
|
386
386
|
names.each do |name|
|
387
|
-
grpc_projection = Google::Datastore::V1::Projection.new(
|
388
|
-
property: Google::Datastore::V1::PropertyReference.new(
|
387
|
+
grpc_projection = Google::Cloud::Datastore::V1::Projection.new(
|
388
|
+
property: Google::Cloud::Datastore::V1::PropertyReference.new(
|
389
389
|
name: name
|
390
390
|
)
|
391
391
|
)
|
@@ -414,7 +414,7 @@ module Google
|
|
414
414
|
#
|
415
415
|
def group_by *names
|
416
416
|
names.each do |name|
|
417
|
-
grpc_property = Google::Datastore::V1::PropertyReference.new(
|
417
|
+
grpc_property = Google::Cloud::Datastore::V1::PropertyReference.new(
|
418
418
|
name: name
|
419
419
|
)
|
420
420
|
@grpc.distinct_on << grpc_property
|