Skip to content

Commit

Permalink
implement bigquery migration driver
Browse files Browse the repository at this point in the history
lint all the things
  • Loading branch information
ocramh committed Oct 9, 2024
1 parent c378583 commit 3b98194
Show file tree
Hide file tree
Showing 10 changed files with 708 additions and 73 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SOURCE ?= file go_bindata github github_ee bitbucket aws_s3 google_cloud_storage godoc_vfs gitlab
DATABASE ?= postgres mysql redshift cassandra spanner cockroachdb yugabytedb clickhouse mongodb sqlserver firebird neo4j pgx pgx5 rqlite
DATABASE ?= postgres mysql redshift cassandra spanner cockroachdb yugabytedb clickhouse mongodb sqlserver firebird neo4j pgx pgx5 rqlite bigquery
DATABASE_TEST ?= $(DATABASE) sqlite sqlite3 sqlcipher
VERSION ?= $(shell git describe --tags 2>/dev/null | cut -c 2-)
TEST_FLAGS ?=
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Database drivers run migrations. [Add a new database?](database/driver.go)
* [Firebird](database/firebird)
* [MS SQL Server](database/sqlserver)
* [rqlite](database/rqlite)
* [Big Query](database/bigquery)

### Database URLs

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

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

20 changes: 20 additions & 0 deletions database/bigquery/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Big Query

See the official [Google Big Query Documentation](https://cloud.google.com/bigquery/docs) for more details.

The provided database URL must be in the following format:

`bigquery://{projectId}/{datasetId}?param=true`

where

- `projectId` is to be replaced with the name of the Google Cloud Platform (GCP) project Id where the Big Query instance has been created.
- `datasetId` is to be replaced with the name of the dataset where migrations will be executed.

| Param | WithInstance Config | Description |
| ------------------------ | ------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `x-migrations-table` | `MigrationsTable` | Name of the migrations table |
| `x-stmt-timeout` | `StmtTimeout` | Duration after which queries are automatically terminated |
| `x-gcp-credentials-file` | | Location of a credential JSON file to use for authenticating the Big Query client |
| `x-insecure` | | When true it specifies that no authentication should be used. To be used for testing purposes only |
| `x-endpoint` | | Overrides the default endpoint to be used by the client when connecting to the database. To be used for testing purposes only |
Loading

0 comments on commit 3b98194

Please sign in to comment.