Skip to content

Commit ce34d50

Browse files
authored
Merge pull request golang-migrate#428 from wyardley/wyardley-docs
docs(spanner): clarify how to set parameters
2 parents 31c2287 + 0010bc8 commit ce34d50

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Database drivers run migrations. [Add a new database?](database/driver.go)
4141

4242
### Database URLs
4343

44-
Database connection strings are specified via URLs. The URL format is driver dependent but generally has the form: `dbdriver://username:password@host:port/dbname?option1=true&option2=false`
44+
Database connection strings are specified via URLs. The URL format is driver dependent but generally has the form: `dbdriver://username:password@host:port/dbname?param1=true&param2=false`
4545

4646
Any [reserved URL characters](https://en.wikipedia.org/wiki/Percent-encoding#Percent-encoding_reserved_characters) need to be escaped. Note, the `%` character also [needs to be escaped](https://en.wikipedia.org/wiki/Percent-encoding#Percent-encoding_the_percent_character)
4747

database/spanner/README.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22

33
## Usage
44

5-
The DSN must be given in the following format.
5+
See [Google Spanner Documentation](https://cloud.google.com/spanner/docs) for
6+
more details.
67

7-
`spanner://projects/{projectId}/instances/{instanceId}/databases/{databaseName}`
8+
The DSN must be given in the following format.
89

9-
See [Google Spanner Documentation](https://cloud.google.com/spanner/docs) for details.
10+
`spanner://projects/{projectId}/instances/{instanceId}/databases/{databaseName}?param=true`
1011

12+
as described in [README.md#database-urls](../../README.md#database-urls)
1113

1214
| Param | WithInstance Config | Description |
1315
| ----- | ------------------- | ----------- |
@@ -18,7 +20,6 @@ See [Google Spanner Documentation](https://cloud.google.com/spanner/docs) for de
1820
| `instanceId` || The id of the instance running Spanner
1921
| `databaseName` || The name of the Spanner database
2022

21-
2223
> **Note:** Google Cloud Spanner migrations can take a considerable amount of
2324
> time. The migrations provided as part of the example take about 6 minutes to
2425
> run on a small instance.
@@ -42,4 +43,4 @@ In order to be able to use more than 1 DDL statement in the same migration file,
4243
4344
To unit test the `spanner` driver, `SPANNER_DATABASE` needs to be set. You'll
4445
need to sign-up to Google Cloud Platform (GCP) and have a running Spanner
45-
instance since it is not possible to run Google Spanner outside GCP.
46+
instance since it is not possible to run Google Spanner outside GCP.

0 commit comments

Comments
 (0)