---
title: "View source for Bigquery - DreamFactory Wiki"
source: "https://wiki.dreamfactory.com/index.php?action=edit&title=Bigquery"
canonical_url: "https://wiki.dreamfactory.com/index.php?action=edit&title=Bigquery"
converted_at: "2026-11-23T04:06:57.865Z"
format: "markdown"
converted_by: "html-to-md-ai"
---
[]()
	
	
	
	# View source for Bigquery

	
		
		← [Bigquery](/Bigquery)
		
		
		
		[Jump to navigation](#mw-head)
		[Jump to search](#searchInput)
		You do not have permission to edit this page, for the following reason:

The action you have requested is limited to users in the group: [Users](/index.php?title=DreamFactory_Wiki:Users&action=edit&redlink=1).---

You can view and copy the source of this page.

{{#seo:
|title=Google BigQuery - DreamFactory Documentation
|title_mode=replace
|description=Connect Google BigQuery to DreamFactory and generate a secure REST API with full read and write access to your datasets
|keywords=BigQuery, Google Cloud, database API, REST API, data warehouse, analytics, service account
|og:title=Google BigQuery
|og:type=article
|og:site_name=DreamFactory Documentation
|og:description=Connect Google BigQuery to DreamFactory and generate a secure REST API with full read and write access to your datasets
}}
'''Connect Google BigQuery to DreamFactory and generate a secure REST API with full read and write access to your datasets'''

&lt;span id="connecting-google-bigquery-to-dreamfactory">&lt;/span>
= 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

-----

&lt;span id="prerequisites">&lt;/span>
== 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|title=Least privilege|Grant the service account only the roles it needs. &lt;code>BigQuery Data Viewer&lt;/code> is enough for a read-only API; add &lt;code>BigQuery Data Editor&lt;/code> only if you intend to write, and &lt;code>BigQuery Job User&lt;/code> so it can run queries.}}

-----

&lt;span id="connecting-bigquery">&lt;/span>
== Connecting BigQuery ==

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

&lt;span id="configuration">&lt;/span>
=== Configuration ===

{| class="wikitable"
|-
! 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 &lt;code>US&lt;/code> or &lt;code>europe-west2&lt;/code>. See [https://cloud.google.com/bigquery/docs/locations BigQuery locations].
|-
| '''Auth Cache Store'''
| Which cache connection holds the auth token. Supported: &lt;code>apc&lt;/code>, &lt;code>array&lt;/code>, &lt;code>database&lt;/code>, &lt;code>file&lt;/code>, &lt;code>memcached&lt;/code>, &lt;code>redis&lt;/code>.
|-
| '''Options'''
| Additional name/value parameters passed to the underlying BigQuery client: &lt;code>authCacheOptions&lt;/code>, &lt;code>authHttpHandler&lt;/code>, &lt;code>httpHandler&lt;/code>, &lt;code>retries&lt;/code>, &lt;code>scopes&lt;/code>, &lt;code>returnInt64AsObject&lt;/code>.
|}

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

-----

&lt;span id="reading-data">&lt;/span>
== Reading data ==

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

&lt;syntaxhighlight lang="bash">curl -X GET \
  "https://{instance}/api/v2/{service_name}/_table/{table_name}?limit=10" \
  -H "X-DreamFactory-API-Key: {api_key}"&lt;/syntaxhighlight>
Filtering, field selection, ordering, grouping, and aggregation (&lt;code>SUM&lt;/code>, &lt;code>COUNT&lt;/code>, &lt;code>AVG&lt;/code>, &lt;code>MIN&lt;/code>, &lt;code>MAX&lt;/code>) are all supported.

-----

&lt;span id="writing-data">&lt;/span>
== Writing data ==

BigQuery services support the full set of write verbs: &lt;code>POST&lt;/code> to insert, &lt;code>PUT&lt;/code>/&lt;code>PATCH&lt;/code> to update, and &lt;code>DELETE&lt;/code> to remove rows.

&lt;span id="inserting">&lt;/span>
=== Inserting ===

&lt;syntaxhighlight lang="bash">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"}]}'&lt;/syntaxhighlight>
&lt;span id="updating-and-deleting-by-filter">&lt;/span>
=== Updating and deleting by filter ===

&lt;syntaxhighlight lang="bash">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"}'&lt;/syntaxhighlight>
{{Warning|title=BigQuery has no primary keys|This is the one place a BigQuery API behaves differently from DreamFactory's other SQL connectors.

BigQuery does not enforce primary keys or uniqueness, so DreamFactory cannot infer an identifier column. Operations addressed by id — &lt;code>PUT&lt;/code>, &lt;code>PATCH&lt;/code>, &lt;code>DELETE&lt;/code>, or &lt;code>GET&lt;/code> on &lt;code>/_table/{table_name}/{id}&lt;/code>, and calls using &lt;code>?ids=&lt;/code> — require you to name the column explicitly with '''&lt;code>id_field&lt;/code>''':

&lt;syntaxhighlight lang="bash">curl -X DELETE \
  "https://{instance}/api/v2/{service_name}/_table/{table_name}/42?id_field=order_id" \
  -H "X-DreamFactory-API-Key: {api_key}"&lt;/syntaxhighlight>
Without it the request fails with:

&lt;blockquote>BigQuery has no primary keys; supply an id_field to update, delete or fetch by id, or use a filter.
&lt;/blockquote>
Because uniqueness is not enforced, an id-addressed call may legitimately match zero rows or several. DreamFactory does not treat a mismatch between the number of ids sent and the number of rows affected as an error, so check the response rather than assuming a one-to-one result. Where you can, prefer filter-based calls, which express the intent directly.}}

{{Note|title=DML requires a WHERE clause|BigQuery requires a predicate on &lt;code>UPDATE&lt;/code> and &lt;code>DELETE&lt;/code>. DreamFactory builds one from your &lt;code>filter&lt;/code> or from the ids you supply, which means an unfiltered "update everything" call is rejected by BigQuery rather than silently rewriting the table.}}

-----

&lt;span id="using-bigquery-with-ai-agents">&lt;/span>
== Using BigQuery with AI agents ==

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

-----

&lt;span id="next-steps">&lt;/span>
== Next steps ==

* '''[[Querying_Filtering|Querying and Filtering Records]]''': The full filter, sort, and aggregation syntax
* '''[[Security/Role_Based_Access|Role-Based Access Control]]''': Restrict which tables and verbs a key can reach
* '''[[AI_Services/Mcp_Service|MCP Server]]''': Expose this dataset to AI agents

[[Category:Bigquery]]
[[Category:Google_Cloud]]
[[Category:Database_Api]]
[[Category:API]]
[[Category:Database]]
[[Category:Difficulty_Intermediate]]

[[Category:API]]
[[Category:Database]]
Templates used on this page:

- [Template:Note](/Template:Note) ([view source](/index.php?title=Template:Note&action=edit))
- [Template:Tip](/Template:Tip) ([view source](/index.php?title=Template:Tip&action=edit))
- [Template:Warning](/Template:Warning) ([view source](/index.php?title=Template:Warning&action=edit))

Return to [Bigquery](/Bigquery).

Retrieved from "[https://wiki.dreamfactory.com/Bigquery](https://wiki.dreamfactory.com/Bigquery)"