---
title: "Google BigQuery - DreamFactory Documentation"
source: "http://wiki.dreamfactory.com/Bigquery"
canonical_url: "http://wiki.dreamfactory.com/Bigquery"
converted_at: "2026-10-22T18:50:41.281Z"
format: "markdown"
converted_by: "html-to-md-ai"
---
[]()
	
	
	
	# Bigquery

	
		From DreamFactory Wiki
		
		
		
		
		[Jump to navigation](#mw-head)
		[Jump to search](#searchInput)
		**Connect Google BigQuery to DreamFactory and generate a secure REST API with full read and write access to your datasets**

## Contents

- [1 Connecting Google BigQuery to DreamFactory](#Connecting_Google_BigQuery_to_DreamFactory)

- [1.1 Prerequisites](#Prerequisites)

- [1.2 Connecting BigQuery](#Connecting_BigQuery)

- [1.2.1 Configuration](#Configuration)

- [1.3 Reading data](#Reading_data)

- [1.4 Writing data](#Writing_data)

- [1.4.1 Inserting](#Inserting)

- [1.4.2 Updating and deleting by filter](#Updating_and_deleting_by_filter)

- [1.5 Using BigQuery with AI agents](#Using_BigQuery_with_AI_agents)

- [1.6 Next steps](#Next_steps)

# Connecting Google BigQuery to DreamFactory

This guide walks you through connecting Google BigQuery to DreamFactory to auto-generate a secure REST API over your datasets. You'll learn how to:

- Authenticate with a Google Cloud service account and expose a BigQuery dataset as REST endpoints

- Read, filter, and aggregate table data

- Insert, update, and delete rows, and what BigQuery's lack of primary keys means for those calls

- Reach the same dataset from an AI agent through DreamFactory's MCP server

---

## Prerequisites

Before connecting BigQuery to DreamFactory, ensure you have:

- **A Google Cloud project** with the BigQuery API enabled and at least one dataset

- **A service account key** — a JSON key file for a service account with access to the dataset

- **DreamFactory Installation**: An up-and-running DreamFactory instance with access to the Admin application

**💡 Tip: Least privilege** Grant the service account only the roles it needs. `BigQuery Data Viewer` is enough for a read-only API; add `BigQuery Data Editor` only if you intend to write, and `BigQuery Job User` so it can run queries.
---

## Connecting BigQuery

Sign into your DreamFactory instance, navigate to **API Generation & Connections**, and create a new service of type **BigQuery**.

### Configuration

Field

Description

**Application Credentials JSON**

The **contents** of your service account key JSON file, pasted in full — not a path to it.

**Project ID**

Your Google Cloud project ID.

**Location**

The dataset location, for example `US` or `europe-west2`. See [BigQuery locations](https://cloud.google.com/bigquery/docs/locations).

**Auth Cache Store**

Which cache connection holds the auth token. Supported: `apc`, `array`, `database`, `file`, `memcached`, `redis`.

**Options**

Additional name/value parameters passed to the underlying BigQuery client: `authCacheOptions`, `authHttpHandler`, `httpHandler`, `retries`, `scopes`, `returnInt64AsObject`.

Once saved, DreamFactory introspects the dataset and generates endpoints under `/api/v2/{service_name}/_table/{table_name}`, along with `_schema` endpoints describing the tables and columns.

---

## Reading data

Reads work as they do for any DreamFactory database service — see [Querying and Filtering Records](/Querying_Filtering) for the full syntax.

```
curl -X GET \
  "https://{instance}/api/v2/{service_name}/_table/{table_name}?limit=10" \
  -H "X-DreamFactory-API-Key: {api_key}"

```

Filtering, field selection, ordering, grouping, and aggregation (`SUM`, `COUNT`, `AVG`, `MIN`, `MAX`) are all supported.

---

## Writing data

BigQuery services support the full set of write verbs: `POST` to insert, `PUT`/`PATCH` to update, and `DELETE` to remove rows.

### Inserting

```
curl -X POST \
  "https://{instance}/api/v2/{service_name}/_table/{table_name}" \
  -H "X-DreamFactory-API-Key: {api_key}" \
  -H "Content-Type: application/json" \
  -d '{"resource": [{"id": 1, "name": "Example"}]}'

```

### Updating and deleting by filter

```
curl -X PATCH \
  "https://{instance}/api/v2/{service_name}/_table/{table_name}?filter=(status='pending')" \
  -H "X-DreamFactory-API-Key: {api_key}" \
  -H "Content-Type: application/json" \
  -d '{"status": "complete"}'

```

**⚠️ Warning: BigQuery has no primary keys**
**ℹ️ Note: DML requires a WHERE clause** BigQuery requires a predicate on `UPDATE` and `DELETE`. DreamFactory builds one from your `filter` or from the ids you supply, which means an unfiltered "update everything" call is rejected by BigQuery rather than silently rewriting the table.
---

## Using BigQuery with AI agents

BigQuery services register in DreamFactory's **Database** service group, so the [MCP Server](/AI_Services/Mcp_Service) discovers them automatically and exposes the standard database tools for them — schema exploration, querying, aggregation, and record management — prefixed with the service name.

---

## Next steps

- **[Querying and Filtering Records](/Querying_Filtering)**: The full filter, sort, and aggregation syntax

- **[Role-Based Access Control](/Security/Role_Based_Access)**: Restrict which tables and verbs a key can reach

- **[MCP Server](/AI_Services/Mcp_Service)**: Expose this dataset to AI agents

Retrieved from "[https://wiki.dreamfactory.com/index.php?title=Bigquery&oldid=972](https://wiki.dreamfactory.com/index.php?title=Bigquery&oldid=972)"
		[Categories](/Special:Categories): - [Bigquery](/index.php?title=Category:Bigquery&action=edit&redlink=1)
- [Google Cloud](/index.php?title=Category:Google_Cloud&action=edit&redlink=1)
- [Database Api](/Category:Database_Api)
- [API](/Category:API)
- [Database](/Category:Database)
- [Difficulty Intermediate](/Category:Difficulty_Intermediate)