Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(spanner): clarify how to set parameters #428

Merged
merged 1 commit into from
Aug 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Database drivers run migrations. [Add a new database?](database/driver.go)

### Database URLs

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`
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`

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)

Expand Down
11 changes: 6 additions & 5 deletions database/spanner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

## Usage

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

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

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

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

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


> **Note:** Google Cloud Spanner migrations can take a considerable amount of
> time. The migrations provided as part of the example take about 6 minutes to
> run on a small instance.
Expand All @@ -42,4 +43,4 @@ In order to be able to use more than 1 DDL statement in the same migration file,

To unit test the `spanner` driver, `SPANNER_DATABASE` needs to be set. You'll
need to sign-up to Google Cloud Platform (GCP) and have a running Spanner
instance since it is not possible to run Google Spanner outside GCP.
instance since it is not possible to run Google Spanner outside GCP.