Google\Cloud\BigQuery\Connection\ConnectionInterface::insertTable PHP Method

insertTable() public method

public insertTable ( array $args = [] ) : array
$args array
return array
    public function insertTable(array $args = []);

Usage Example

Beispiel #1
0
 /**
  * Creates a table.
  *
  * Example:
  * ```
  * $table = $dataset->createTable('aTable');
  * ```
  *
  * @see https://cloud.google.com/bigquery/docs/reference/v2/tables/insert Tables insert API documentation.
  *
  * @param array $options [optional] {
  *     Configuration options.
  *
  *     @type array $metadata The available options for metadata are outlined
  *           at the
  *           [Table Resource API docs](https://cloud.google.com/bigquery/docs/reference/v2/tables#resource)
  * }
  * @return Table
  */
 public function createTable($id, array $options = [])
 {
     if (isset($options['metadata'])) {
         $options += $options['metadata'];
         unset($options['metadata']);
     }
     $response = $this->connection->insertTable(['projectId' => $this->identity['projectId'], 'datasetId' => $this->identity['datasetId'], 'tableReference' => $this->identity + ['tableId' => $id]] + $options);
     return new Table($this->connection, $id, $this->identity['datasetId'], $this->identity['projectId'], $response);
 }