NAME
Google::Cloud::Datastore::V1::DatastoreClient - Client library for Google Cloud Services
SYNOPSIS
use Google::Cloud::Datastore::V1::DatastoreClient;
use Google::Auth;
my $auth = Google::Auth->default();
# 1. High-performance gRPC Transport (Default)
my $grpc_client = Google::Cloud::Datastore::V1::DatastoreClient->new(
credentials => $auth,
transport => 'grpc', # Optional: 'grpc' is default
);
# 2. HTTP/REST Transport
my $rest_client = Google::Cloud::Datastore::V1::DatastoreClient->new(
credentials => $auth,
transport => 'rest',
);
# Execute service methods
my $res = $grpc_client->some_method( %params );
DESCRIPTION
Google::Cloud::Datastore::V1::DatastoreClient is an auto-generated client library for Google Cloud Services.
It provides a unified client interface supporting both high-performance HTTP/2 gRPC and HTTP/REST transports, with automatic Google Cloud Application Default Credentials (ADC) resolution and typed Protocol Buffers message handling.
SOURCE
Generated from the following Protocol Buffers schemas:
googleapis/google/datastore/v1/aggregation_result.protogoogleapis/google/datastore/v1/datastore.protogoogleapis/google/datastore/v1/entity.protogoogleapis/google/datastore/v1/query.protogoogleapis/google/datastore/v1/query_profile.proto
CONSTRUCTOR
new
my $client = Google::Cloud::Datastore::V1::DatastoreClient->new(
credentials => $auth, # Optional: Google::Auth object (defaults to ADC)
transport => 'grpc', # Optional: 'grpc' (default) or 'rest'
);
ATTRIBUTES
credentials
Returns or accepts the Google::Auth credentials object.
transport
Returns or accepts the active transport object (Google::gRPC::Client or Google::Cloud::REST::Client).
METHODS
METHODS
The following RPC methods are available in this client:
lookup
my $response = $client->lookup( project_id => $project_id, database_id => $database_id, read_options => $read_options, keys => [ ... ], property_mask => $property_mask, request_options => $request_options, );Calls the RPC method
Lookupongoogle.datastore.v1.Datastore.Request: Google::Datastore::V1::Datastore::LookupRequest
Returns: Google::Datastore::V1::Datastore::LookupResponse
Parameters:
project_id-stringdatabase_id-stringread_options- Google::Datastore::V1::Datastore::ReadOptionskeys- ArrayRef of Google::Datastore::V1::Entity::Keyproperty_mask- Google::Datastore::V1::Datastore::PropertyMaskrequest_options- Google::Datastore::V1::Datastore::RequestOptions
run_query
my $response = $client->run_query( project_id => $project_id, database_id => $database_id, partition_id => $partition_id, read_options => $read_options, property_mask => $property_mask, explain_options => $explain_options, request_options => $request_options, );Calls the RPC method
RunQueryongoogle.datastore.v1.Datastore.Request: Google::Datastore::V1::Datastore::RunQueryRequest
Returns: Google::Datastore::V1::Datastore::RunQueryResponse
Parameters:
project_id-stringdatabase_id-stringpartition_id- Google::Datastore::V1::Entity::PartitionIdread_options- Google::Datastore::V1::Datastore::ReadOptionsproperty_mask- Google::Datastore::V1::Datastore::PropertyMaskexplain_options- Google::Datastore::V1::QueryProfile::ExplainOptionsrequest_options- Google::Datastore::V1::Datastore::RequestOptions
run_aggregation_query
my $response = $client->run_aggregation_query( project_id => $project_id, database_id => $database_id, partition_id => $partition_id, read_options => $read_options, explain_options => $explain_options, request_options => $request_options, );Calls the RPC method
RunAggregationQueryongoogle.datastore.v1.Datastore.Request: Google::Datastore::V1::Datastore::RunAggregationQueryRequest
Returns: Google::Datastore::V1::Datastore::RunAggregationQueryResponse
Parameters:
project_id-stringdatabase_id-stringpartition_id- Google::Datastore::V1::Entity::PartitionIdread_options- Google::Datastore::V1::Datastore::ReadOptionsexplain_options- Google::Datastore::V1::QueryProfile::ExplainOptionsrequest_options- Google::Datastore::V1::Datastore::RequestOptions
begin_transaction
my $response = $client->begin_transaction( project_id => $project_id, database_id => $database_id, transaction_options => $transaction_options, request_options => $request_options, );Calls the RPC method
BeginTransactionongoogle.datastore.v1.Datastore.Request: Google::Datastore::V1::Datastore::BeginTransactionRequest
Returns: Google::Datastore::V1::Datastore::BeginTransactionResponse
Parameters:
project_id-stringdatabase_id-stringtransaction_options- Google::Datastore::V1::Datastore::TransactionOptionsrequest_options- Google::Datastore::V1::Datastore::RequestOptions
commit
my $response = $client->commit( project_id => $project_id, database_id => $database_id, mode => $mode, mutations => [ ... ], request_options => $request_options, );Calls the RPC method
Commitongoogle.datastore.v1.Datastore.Request: Google::Datastore::V1::Datastore::CommitRequest
Returns: Google::Datastore::V1::Datastore::CommitResponse
Parameters:
project_id-stringdatabase_id-stringmutations- ArrayRef of Google::Datastore::V1::Datastore::Mutationrequest_options- Google::Datastore::V1::Datastore::RequestOptions
rollback
my $response = $client->rollback( project_id => $project_id, database_id => $database_id, transaction => $transaction, request_options => $request_options, );Calls the RPC method
Rollbackongoogle.datastore.v1.Datastore.Request: Google::Datastore::V1::Datastore::RollbackRequest
Returns: Google::Datastore::V1::Datastore::RollbackResponse
Parameters:
project_id-stringdatabase_id-stringtransaction-bytesrequest_options- Google::Datastore::V1::Datastore::RequestOptions
allocate_ids
my $response = $client->allocate_ids( project_id => $project_id, database_id => $database_id, keys => [ ... ], request_options => $request_options, );Calls the RPC method
AllocateIdsongoogle.datastore.v1.Datastore.Request: Google::Datastore::V1::Datastore::AllocateIdsRequest
Returns: Google::Datastore::V1::Datastore::AllocateIdsResponse
Parameters:
project_id-stringdatabase_id-stringkeys- ArrayRef of Google::Datastore::V1::Entity::Keyrequest_options- Google::Datastore::V1::Datastore::RequestOptions
reserve_ids
my $response = $client->reserve_ids( project_id => $project_id, database_id => $database_id, keys => [ ... ], request_options => $request_options, );Calls the RPC method
ReserveIdsongoogle.datastore.v1.Datastore.Request: Google::Datastore::V1::Datastore::ReserveIdsRequest
Returns: Google::Datastore::V1::Datastore::ReserveIdsResponse
Parameters:
project_id-stringdatabase_id-stringkeys- ArrayRef of Google::Datastore::V1::Entity::Keyrequest_options- Google::Datastore::V1::Datastore::RequestOptions
LICENSE AND COPYRIGHT
Copyright (C) 2026 Google LLC
This program is released under the Apache 2.0 license.