github.com/kruftik/go-migrate@v3.5.4+incompatible/database/spanner/README.md (about)

     1  # Google Cloud Spanner
     2  
     3  ## Usage
     4  
     5  The DSN must be given in the following format.
     6  
     7  `spanner://projects/{projectId}/instances/{instanceId}/databases/{databaseName}`
     8  
     9  See [Google Spanner Documentation](https://cloud.google.com/spanner/docs) for details.
    10  
    11  
    12  | Param | WithInstance Config | Description |
    13  | ----- | ------------------- | ----------- |
    14  | `x-migrations-table` | `MigrationsTable` | Name of the migrations table |
    15  | `url` | `DatabaseName` | The full path to the Spanner database resource. If provided as part of `Config` it must not contain a scheme or query string to match the format `projects/{projectId}/instances/{instanceId}/databases/{databaseName}`|
    16  | `projectId` || The Google Cloud Platform project id
    17  | `instanceId` || The id of the instance running Spanner
    18  | `databaseName` || The name of the Spanner database
    19  
    20  
    21  > **Note:** Google Cloud Spanner migrations can take a considerable amount of 
    22  > time. The migrations provided as part of the example take about 6 minutes to 
    23  > run on a small instance.
    24  >
    25  > ```log
    26  > 1481574547/u create_users_table (21.354507597s)
    27  > 1496539702/u add_city_to_users (41.647359754s)
    28  > 1496601752/u add_index_on_user_emails (2m12.155787369s)
    29  > 1496602638/u create_books_table (2m30.77299181s)
    30  
    31  ## Testing
    32  
    33  To unit test the `spanner` driver, `SPANNER_DATABASE` needs to be set. You'll
    34  need to sign-up to Google Cloud Platform (GCP) and have a running Spanner
    35  instance since it is not possible to run Google Spanner outside GCP.