-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add proxies for the remainder of the changed methods.
Signed-off-by: dblock <[email protected]>
- Loading branch information
Showing
3 changed files
with
61 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
return <<<'EOD' | ||
/** | ||
* $params['query'] = (string) The SQL Query | ||
* | ||
* @param array{'query': string} $params Associative array of parameters | ||
* @return array | ||
* | ||
* Note: Use of query parameter is deprecated. Pass it in `body` instead. | ||
*/ | ||
public function explain(array $params): array | ||
{ | ||
$endpointBuilder = $this->endpoints; | ||
$body = $this->extractArgument($params, 'body'); | ||
$query = $this->extractArgument($params, 'query'); | ||
/** @var AbstractEndpoint $endpoint */ | ||
$endpoint = $endpointBuilder('Sql\Explain'); | ||
$endpoint->setBody(array_merge($body, [ | ||
'query' => $query, | ||
])); | ||
$endpoint->setParams($params); | ||
return $this->performRequest($endpoint); | ||
} | ||
EOD; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
return <<<'EOD' | ||
/** | ||
* $params['query'] = (string) The SQL Query | ||
* $params['format'] = (string) The response format | ||
* $params['cursor'] = (string) The cursor given by the server | ||
* $params['fetch_size'] = (int) The fetch size | ||
* | ||
* @param array{'query'?: string, 'cursor'?: string, 'fetch_size'?: int} $params Associative array of parameters | ||
* @return array | ||
* | ||
* Note: Use of `query`, `cursor` and `fetch_size` parameters is deprecated. Pass them in `body` instead. | ||
* | ||
*/ | ||
public function query(array $params): array | ||
{ | ||
$endpointBuilder = $this->endpoints; | ||
/** @var AbstractEndpoint $endpoint */ | ||
$endpoint = $endpointBuilder('Sql\Query'); | ||
$body = $this->extractArgument($params, 'body'); | ||
$endpoint->setBody(array_merge($body, array_filter([ | ||
'query' => $this->extractArgument($params, 'query'), | ||
'cursor' => $this->extractArgument($params, 'cursor'), | ||
'fetch_size' => $this->extractArgument($params, 'fetch_size'), | ||
]))); | ||
$endpoint->setParams($params); | ||
return $this->performRequest($endpoint); | ||
} | ||
EOD; |