PHPackages                             giginc/cakephp5-driver-bigquery - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. giginc/cakephp5-driver-bigquery

ActiveCakephp-plugin[Database &amp; ORM](/categories/database)

giginc/cakephp5-driver-bigquery
===============================

BigQuery direver for CakePHP 5.x

1.0.1(1mo ago)053↓66.7%MITPHPPHP ^8.2

Since Apr 21Pushed 1mo agoCompare

[ Source](https://github.com/giginc/cakephp5-driver-bigquery)[ Packagist](https://packagist.org/packages/giginc/cakephp5-driver-bigquery)[ RSS](/packages/giginc-cakephp5-driver-bigquery/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (6)Versions (3)Used By (0)

BigQuery Driver for Cakephp5.x
==============================

[](#bigquery-driver-for-cakephp5x)

An BigQuery for CakePHP 5.x

Installing via composer
-----------------------

[](#installing-via-composer)

Install [composer](http://getcomposer.org) and run:

```
composer require giginc/cakephp5-driver-bigquery
```

Defining a connection
---------------------

[](#defining-a-connection)

Now, you need to set the connection in your config/app.php file:

```
 'Datasources' => [
...
    'bigquery' => [
        'className' => 'Giginc\BigQuery\Database\Connection',
        'driver' => 'Giginc\BigQuery\Database\Driver\BigQuery',
        'projectId' => env('BIGQUERY_PROJECT_ID', 'project_id'),
        'dataSet' => env('BIGQUERY_DATASET', 'dataset'),
        'keyFile' => [], // Console. Ex: json_decode(file_get_contents($path), true).
        'keyFilePath' => null, //The full path to your service account credentials .json file retrieved.
        'requestTimeout' => 0, // Defaults to 0 with REST and 60 with gRPC.
        'retries' => 3, // Number of retries for a failed request. Defaults to 3.
        'location' => 'us', // If provided, determines the default geographic location used when creating datasets and managing jobs.
        'maximumBytesBilled' => 1000000,
    ],

],
```

Models
------

[](#models)

After that, you need to load Giginc\\BigQuery\\ORM\\Table in your tables class:

### Table

[](#table)

```
//src/Model/Table/ProductsTable.php
namespace App\Model\Table;

use Giginc\BigQuery\ORM\Table;

/**
 * ProductsTable Table
 *
 * @uses Table
 * @package Table
 */
class ProductsTable extends Table
{
    public function initialize(array $config): void
    {
        parent::initialize($config);

        $this->setTable('products_%Y%m%d');
        $this->setSchema([
            [
                "name" => "name",
                "type" => "STRING",
                "mode" => "NULLABLE",
            ],[
                "name" => "description",
                "type" => "STRING",
                "mode" => "NULLABLE",
            ],[
                "name" => "count",
                "type" => "INTEGER",
                "mode" => "NULLABLE",
            ],[
                "name" => "created_at",
                "type" => "DATETIME",
                "mode" => "NULLABLE",
            ],
        ]);
    }

    public static function defaultConnectionName(): string
    {
        return 'bigquery';
    }

    public function findOk($query, array $options)
    {
        $query = $query
            ->where([
                'status' => 'ok',
            ]);

        return $query;
    }
}
```

### Entity

[](#entity)

```
//src/Model/Entity/Product.php
namespace App\Model\Entity;

use Cake\ORM\Entity;

/**
 * Product Entity
 *
 * @uses Entity
 * @package Entity
 */
class Product extends Entity
{
    protected $_accessible = [
        '*' => true,
        'id' => false,
    ];

    protected $_virtual = [
    ];
}

## Controllers

```php
namespace App\Controller;

use App\Controller\AppController;

/**
 * Pages Controller
 *
 * @property \App\Model\Table\PagesTable $Pages
 *
 * @method \App\Model\Entity\Review[]|\Cake\Datasource\ResultSetInterface paginate($object = null, array $settings = [])
 */
class PagesController extends AppController
{
    /**
     * Index method
     *
     * @access public
     * @return \Cake\Http\Response|void
     */
    public function index()
    {
        // select
        $data = $this->fetchTable('Products')->date('2021-04-12')
            ->bqFind()
            ->fields([
                'name',
                'description',
                'MAX(count) AS max',
                'COUNT(*) AS count',
            ])
            ->where([
                'name' => 'iphone',
                'count >' => 0,
            ])
            ->group(['name', 'description'])
            ->order(['name' => 'DESC'])
            ->limit(5)
            ->all();

        // insert
        $this->fetchTable('Products')->insert([
            'name' => 'iPhoneXR',
            'description' => 'iPhoneXR',
            'created_at' => '2021-04-21',
        ]);
    }
}
```

LICENSE
-------

[](#license)

[The MIT License (MIT) Copyright (c) 2026](http://opensource.org/licenses/MIT)

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance92

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~9 days

Total

2

Last Release

40d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a6e6faaa4785c7f5812464198b2503a25975f08e8c5a6239c33dc023dd272ab0?d=identicon)[issys16](/maintainers/issys16)

![](https://avatars.githubusercontent.com/u/3604122?v=4)[kgw](/maintainers/kgw)[@KGW](https://github.com/KGW)

---

Top Contributors

[![kgws](https://avatars.githubusercontent.com/u/83611?v=4)](https://github.com/kgws "kgws (4 commits)")

---

Tags

pluginormcakephpdatasourcedrivercakephp-pluginbigquerycakephp5

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/giginc-cakephp5-driver-bigquery/health.svg)

```
[![Health](https://phpackages.com/badges/giginc-cakephp5-driver-bigquery/health.svg)](https://phpackages.com/packages/giginc-cakephp5-driver-bigquery)
```

###  Alternatives

[dereuromark/cakephp-shim

A CakePHP plugin to shim applications between major framework versions.

401.1M21](/packages/dereuromark-cakephp-shim)[dereuromark/cakephp-databaselog

A CakePHP plugin for storing and viewing application logs in the database

44170.0k2](/packages/dereuromark-cakephp-databaselog)[dereuromark/cakephp-tinyauth

A CakePHP plugin to handle user authentication and authorization the easy way.

131237.3k12](/packages/dereuromark-cakephp-tinyauth)[dereuromark/cakephp-setup

A CakePHP plugin containing lots of useful management tools

35184.7k2](/packages/dereuromark-cakephp-setup)[xety/cake3-upload

Cake3 plugin to upload files.

2625.9k1](/packages/xety-cake3-upload)[dereuromark/cakephp-translate

A CakePHP plugin for managing translations

1711.7k](/packages/dereuromark-cakephp-translate)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
