Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ keys/
.testing
.split
__pycache__

# VS Code local workspace settings
.vscode
18 changes: 16 additions & 2 deletions Datastore/src/DatastoreClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
namespace Google\Cloud\Datastore;

use DomainException;
use Google\ApiCore\ArrayTrait;
use Google\ApiCore\ClientOptionsTrait;
use Google\Auth\FetchAuthTokenInterface;
use Google\Cloud\Core\ArrayTrait;
use Google\Cloud\Core\ClientTrait;
use Google\Cloud\Core\Int64;
use Google\Cloud\Datastore\Connection\ConnectionInterface;
Expand All @@ -30,6 +31,7 @@
use Google\Cloud\Datastore\Query\GqlQuery;
use Google\Cloud\Datastore\Query\Query;
use Google\Cloud\Datastore\Query\QueryInterface;
use Google\Cloud\Datastore\V1\Client\DatastoreClient as DatastoreGapicClient;
use InvalidArgumentException;
use Psr\Cache\CacheItemPoolInterface;
use Psr\Http\Message\StreamInterface;
Expand Down Expand Up @@ -90,12 +92,17 @@ class DatastoreClient
{
use ArrayTrait;
use ClientTrait;
use ClientOptionsTrait;
use DatastoreTrait;

const VERSION = '1.27.2';

const FULL_CONTROL_SCOPE = 'https://www.googleapis.com/auth/datastore';

private const GAPIC_KEYS = [
DatastoreGapicClient::class
];

/**
* @deprecated
* @var ConnectionInterface
Expand Down Expand Up @@ -166,8 +173,15 @@ public function __construct(array $config = [])
'scopes' => [self::FULL_CONTROL_SCOPE],
'projectIdRequired' => true,
'hasEmulator' => (bool) $emulatorHost,
'emulatorHost' => $emulatorHost
'emulatorHost' => $emulatorHost,
'transportConfig' => [
'grpc' => [
// increase default limit to 4MB to prevent metadata exhausted errors
'stubOpts' => ['grpc.max_metadata_size' => 4 * 1024 * 1024,]
],
],
];
$config = $this->buildClientOptions($config);

$config = $this->configureAuthentication($config);
$this->connection = $connectionType === 'grpc'
Expand Down