I am integrating a bigQuery in my google cloud project. I have settle up all the requirements which required to integrate the big query. Now i want to perform the insert operation through my php file. I have created a dataset and table in bigQuery.
- Dataset Name- userDetails
- Table name- userInfo
I want to make insertion in this table through my php file. Before this, I am saving user details in cloud datastore but now my requirement has changed and I want to save these details in bigQuery. Here is my code for inserting the values in cloud datastore:
$datastore = new Google\Cloud\Datastore\DatastoreClient(['projectId' => 'google_project_id']);
$key = $datastore->key($entity_kind);
$key->ancestor(parent_kind, key);
$entity = $datastore->entity($key);
/*------------- Set user entity properties --------------*/
$entity['name'] = $username;
$entity['date_of_birth'] = strtotime(date('Y-m-d H:i'));
$entity['religion'] = $religion;
$entity->setExcludeFromIndexes(['religion']);
$datastore->insert($entity);
Similarly, How i can do this in big query rather than datastore?
Thanks!