renedekat / laravel-bigquery
Requires
- php: ^7.0
- google/cloud: ^0.10.2|^0.11.0|^0.12.0|^0.13.0|^0.21.0|^0.22.0|^0.23.0|^0.24.0|^0.25.0|^0.26.0|^0.27.0|^0.28.0|^0.29.0|^0.30.0|^0.31.0|^0.32.0|^0.33.0|^0.34.0|^0.35.0
- illuminate/support: ~5.4.0|~5.5.0
- madewithlove/illuminate-psr-cache-bridge: ^1.0
Requires (Dev)
- mockery/mockery: ^0.9.5
- orchestra/testbench: ~3.4.6|~3.5.0
- phpunit/phpunit: ^6.1
This package is not auto-updated.
Last update: 2024-12-14 16:30:57 UTC
README
Using this package you can easily interact with the Google BigQuery API.
Install
This package can be installed through Composer.
$ composer require renedekat/laravel-bigquery
In Laravel 5.5 the package will autoregister the service provider. In Laravel 5.4 you must install this service provider.
// config/app.php 'providers' => [ ... ReneDeKat\BigQuery\BigQueryServiceProvider::class, ... ];
In Laravel 5.5 the package will autoregister the facade. In Laravel 5.4 you must install the facade manually.
// config/app.php 'aliases' => [ ... 'BigQuery' => ReneDeKat\BigQuery\BigQueryFacade::class, ... ];
Optionally, you can publish the config file of this package with this command:
php artisan vendor:publish --provider="ReneDeKat\BigQuery\BigQueryServiceProvider"
The following config file will be published in config/bigquery.php
return [ /* |-------------------------------------------------------------------------- | Application Credentials |-------------------------------------------------------------------------- | | Path to the Service Account Credentials JSON File | | https://googlecloudplatform.github.io/google-cloud-php/#/docs/google-cloud/v0.35.0/guides/authentication | */ 'application_credentials' => env('GOOGLE_CLOUD_APPLICATION_CREDENTIALS'), /* |-------------------------------------------------------------------------- | Project ID |-------------------------------------------------------------------------- | | The Project Name is a user-friendly name, | while the Project ID is required by the Google Cloud client libraries to authenticate API requests. | */ 'project_id' => env('GOOGLE_CLOUD_PROJECT_ID'), /* |-------------------------------------------------------------------------- | Client Auth Cache Store |-------------------------------------------------------------------------- | | This option controls the auth cache connection that gets used. | | Supported: "apc", "array", "database", "file", "memcached", "redis" | */ 'auth_cache_store' => 'file', /* |-------------------------------------------------------------------------- | Client Options |-------------------------------------------------------------------------- | | Here you may configure additional parameters that | the underlying BigQueryClient will use. | | Optional parameters: "authCacheOptions", "authHttpHandler", "httpHandler", "retries", "scopes", "returnInt64AsObject" */ 'client_options' => [ 'retries' => 3, // Default ], ];
Usage
This package just initialize the BigQuery connection, you can use every method like in Google's API. You can use the provided Facade or retrieve the it from the IoC Container.
BigQuery::apiMethod(); app('bigquery')->apiMethod();
Here are two basic example to create a dataset and check for existence of a table
Create Dataset
$dataset = BigQuery::createDataset('myNewDataSet');
Check Existence Of A Table
BigQuery::dataset(myNewDataSet)->table('aTable')->exists());
Change log
Please see CHANGELOG for more information what has changed recently.
Testing
$ vendor/bin/phpunit
Contributing
Please see CONTRIBUTING and CONDUCT for details.
Security
If you discover any security related issues, please email githubissues@schulze.co instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.