Skip to content

Commit bb25a51

Browse files
committed
implement big query migration driver
1 parent c378583 commit bb25a51

File tree

10 files changed

+708
-73
lines changed

10 files changed

+708
-73
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
SOURCE ?= file go_bindata github github_ee bitbucket aws_s3 google_cloud_storage godoc_vfs gitlab
2-
DATABASE ?= postgres mysql redshift cassandra spanner cockroachdb yugabytedb clickhouse mongodb sqlserver firebird neo4j pgx pgx5 rqlite
2+
DATABASE ?= postgres mysql redshift cassandra spanner cockroachdb yugabytedb clickhouse mongodb sqlserver firebird neo4j pgx pgx5 rqlite bigquery
33
DATABASE_TEST ?= $(DATABASE) sqlite sqlite3 sqlcipher
44
VERSION ?= $(shell git describe --tags 2>/dev/null | cut -c 2-)
55
TEST_FLAGS ?=

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ Database drivers run migrations. [Add a new database?](database/driver.go)
4444
* [Firebird](database/firebird)
4545
* [MS SQL Server](database/sqlserver)
4646
* [rqlite](database/rqlite)
47+
* [Big Query](database/bigquery)
4748

4849
### Database URLs
4950

@@ -194,3 +195,4 @@ Also have a look at the [FAQ](FAQ.md).
194195
---
195196

196197
Looking for alternatives? [https://awesome-go.com/#database](https://awesome-go.com/#database).
198+

database/bigquery/README.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Big Query
2+
3+
See the official [Google Big Query Documentation](https://cloud.google.com/bigquery/docs) for more details.
4+
5+
The provided database URL must be in the following format:
6+
7+
`bigquery://{projectId}/{datasetId}?param=true`
8+
9+
where
10+
11+
- `projectId` is to be replaced with the name of the Google Cloud Platform (GCP) project Id where the Big Query instance has been created.
12+
- `datasetId` is to be replaced with the name of the dataset where migrations will be executed.
13+
14+
| Param | WithInstance Config | Description |
15+
| ------------------------ | ------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
16+
| `x-migrations-table` | `MigrationsTable` | Name of the migrations table |
17+
| `x-stmt-timeout` | `StmtTimeout` | Duration after which queries are automatically terminated |
18+
| `x-gcp-credentials-file` | | Location of a credential JSON file to use for authenticating the Big Query client |
19+
| `x-insecure` | | When true it specifies that no authentication should be used. To be used for testing purposes only |
20+
| `x-endpoint` | | Overrides the default endpoint to be used by the client when connecting to the database. To be used for testing purposes only |

0 commit comments

Comments
 (0)