Skip to content
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
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ tx.QueryContext(ctx, "SELECT SingerId, Name FROM Singers WHERE SingerId = ?", 12

## Transactions

- Read-write transactions always uses the strongest isolation level and ignore the user-specified level.
- Read-write transactions support isolation levels `Serializable`, `Snapshot` and `RepeatableRead`.
- Read-only transactions do strong-reads by default. Read-only transactions must be ended by calling
either Commit or Rollback. Calling either of these methods will end the current read-only
transaction and return the session that is used to the session pool.
transaction.

```go
tx, err := db.BeginTx(ctx, &sql.TxOptions{}) // Read-write transaction.
Expand Down Expand Up @@ -226,6 +226,11 @@ $ gcloud beta emulators spanner start
$ export SPANNER_EMULATOR_HOST=localhost:9010
```

### Automatically Create Instance and Database on the Emulator
You can also add the `autoConfigEmulator=true` option to the connection string. This will instruct the driver
to connect to the Spanner emulator, and to automatically create the Spanner instance and database on the
emulator. See [examples/emulator](examples/emulator) for a working example.

## Spanner PostgreSQL Interface

This driver works with both Spanner GoogleSQL and PostgreSQL dialects.
Expand Down
4 changes: 2 additions & 2 deletions driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ var noopLogger = slog.New(slog.NewTextHandler(io.Discard, &slog.HandlerOptions{L
// The default is false
// - enableEndToEndTracing: Boolean that indicates if end-to-end tracing is enabled
// The default is false
// - minSessions: The minimum number of sessions in the backing session pool. The default is 100.
// - maxSessions: The maximum number of sessions in the backing session pool. The default is 400.
// - minSessions (DEPRECATED): The minimum number of sessions in the backing session pool. The default is 100. This option is deprecated, as the driver by default uses a single multiplexed session for all operations.
// - maxSessions (DEPRECATED): The maximum number of sessions in the backing session pool. The default is 400. This option is deprecated, as the driver by default uses a single multiplexed session for all operations.
// - numChannels: The number of gRPC channels to use to communicate with Cloud Spanner. The default is 4.
// - optimizerVersion: Sets the default query optimizer version to use for this connection.
// - optimizerStatisticsPackage: Sets the default query optimizer statistic package to use for this connection.
Expand Down
Loading