PHP code example of dataground / bq-jsonstore

1. Go to this page and download the library: Download dataground/bq-jsonstore library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

dataground / bq-jsonstore example snippets


$bqbs = new BigQueryBatchService(
    'myproject',
    new BigQueryClient([
      'projectId' => 'myproject',
      'keyFile' => json_decode(file_get_contents('my-gcp-key.json'), true)
  ])
);
  
$bqbs->start('mydataset');
$bqbs->add('mytable', 'something-unique', ['my-fancy-json-thing => ['foo' => 'bar']]);
$bqbs->delete('mytable', 'other-unique-thing');
$bqbs->flush();