diff --git a/src/Client.php b/src/Client.php index 1e5a7a9..1a7ebd7 100644 --- a/src/Client.php +++ b/src/Client.php @@ -22,7 +22,7 @@ class Client private const int DEFAULT_BACKOFF_RETRIES = 3; private const int GUZZLE_CONNECT_TIMEOUT_SECONDS = 10; private const int GUZZLE_TIMEOUT_SECONDS = 120; - private const int DEFAULT_MAX_WAIT_SECONDS = 30; + protected const int DEFAULT_MAX_WAIT_SECONDS = 30; private string $apiUrl; private string $tokenString; diff --git a/src/ClientWrapper.php b/src/ClientWrapper.php new file mode 100644 index 0000000..6a7b295 --- /dev/null +++ b/src/ClientWrapper.php @@ -0,0 +1,56 @@ + + */ + public function submitQueryJobWrapper(array $requestBody): array + { + return $this->submitQueryJob($this->branchId, $this->workspaceId, $requestBody); + } + + /** + * Execute a workspace query and wait for results + * + * @param array{statements: string[], transactional?: bool} $requestBody + * @return array{ + * queryJobId: string, + * status: string, + * statements: array>, + * results: array{ + * "columns": array, + * "data": array>, + * "status": string, + * "rowsAffected": int + * }[], + * } + */ + public function executeWorkspaceQueryWrapper( + array $requestBody, + int $maxWaitSeconds = parent::DEFAULT_MAX_WAIT_SECONDS, + ): array { + return $this->executeWorkspaceQuery($this->branchId, $this->workspaceId, $requestBody, $maxWaitSeconds); + } +}