1# Changes
2
3## v1.10.0
4
5* feat(spanner): add support for NUMERIC data type (#2415)
6* feat(spanner): add custom type support to spanner.Key (#2748)
7* feat(spanner/spannertest): add support for bool parameter types (#2674)
8* fix(spanner): update PDML to take sessions from pool (#2736)
9* spanner/spansql: update docs on TableAlteration, ColumnAlteration (#2825)
10* spanner/spannertest: support dropping columns (#2823)
11* spanner/spannertest: implement GetDatabase (#2802)
12* spanner/spannertest: fix aggregation in query evaluation for empty inputs (#2803)
13
14## v1.9.0
15
16* Features:
17  - feat(spanner): support custom field type (#2614)
18* Bugfixes:
19  - fix(spanner): call ctx.cancel after stats have been recorded (#2728)
20  - fix(spanner): retry session not found for read (#2724)
21  - fix(spanner): specify credentials with SPANNER_EMULATOR_HOST (#2701)
22  - fix(spanner): update pdml to retry EOS internal error (#2678)
23* Misc:
24  - test(spanner): unskip tests for emulator (#2675)
25* spansql/spannertest:
26  - spanner/spansql: restructure types and parsing for column options (#2656)
27  - spanner/spannertest: return error for Read with no keys (#2655)
28
29## v1.8.0
30
31* Features:
32  - feat(spanner): support of client-level custom retry settings (#2599)
33  - feat(spanner): add a statement-based way to run read-write transaction. (#2545)
34* Bugfixes:
35  - fix(spanner): set 'gccl' to the request header. (#2609)
36  - fix(spanner): add the missing resource prefix (#2605)
37  - fix(spanner): fix the upgrade of protobuf. (#2583)
38  - fix(spanner): do not copy protobuf messages by value. (#2581)
39  - fix(spanner): fix the required resource prefix. (#2580)
40  - fix(spanner): add extra field to ignore with cmp (#2577)
41  - fix(spanner): remove appengine-specific numChannels. (#2513)
42* Misc:
43  - test(spanner): log warning instead of fail for stress test (#2559)
44  - test(spanner): fix failed TestRsdBlockingStates test (#2597)
45  - chore(spanner): cleanup mockserver and mockclient (#2414)
46
47## v1.7.0
48
49* Retry:
50  - Only retry certain types of internal errors. (#2460)
51* Tracing/metrics:
52  - Never sample `ping()` trace spans (#2520)
53  - Add oc tests for session pool metrics. (#2416)
54* Encoding:
55  - Allow encoding struct with custom types to mutation (#2529)
56* spannertest:
57  - Fix evaluation on IN (#2479)
58  - Support MIN/MAX aggregation functions (#2411)
59* Misc:
60  - Fix TestClient_WithGRPCConnectionPoolAndNumChannels_Misconfigured test (#2539)
61  - Cleanup backoff files and rename a variable (#2526)
62  - Fix TestIntegration_DML test to return err from tx (#2509)
63  - Unskip tests for emulator 0.8.0. (#2494)
64  - Fix TestIntegration_StartBackupOperation test. (#2418)
65  - Fix flakiness in TestIntegration_BatchDML_Error
66  - Unskip TestIntegration_BatchDML and TestIntegration_BatchDML_TwoStatements
67    for emulator by checking the existence of status.
68  - Fix TestStressSessionPool test by taking lock while getting sessions from
69    hc.
70
71## v1.6.0
72
73* Sessions:
74  - Increase the number of sessions in batches instead of one by one when
75    additional sessions are needed. The step size is set to 25, which means
76    that whenever the session pool needs at least one more session, it will
77    create a batch of 25 sessions.
78* Emulator:
79  - Run integration tests against the emulator in Kokoro Presubmit.
80* RPC retrying:
81  - Retry CreateDatabase on retryable codes.
82* spannertest:
83  - Change internal representation of DATE/TIMESTAMP values.
84* spansql:
85  - Cleanly parse adjacent comment marker/terminator.
86  - Support FROM aliases in SELECT statements.
87* Misc:
88  - Fix comparing errors in tests.
89  - Fix flaky session pool test.
90  - Increase timeout in TestIntegration_ReadOnlyTransaction.
91  - Fix incorrect instance IDs when deleting instances in tests.
92  - Clean up test instances.
93  - Clearify docs on Aborted transaction.
94  - Fix timeout+staleness bound for test
95  - Remove the support for resource-based routing.
96  - Fix TestTransaction_SessionNotFound test.
97
98## v1.5.1
99
100* Fix incorrect decreasing metrics, numReads and numWrites.
101* Fix an issue that XXX fields/methods are internal to proto and may change
102  at any time. XXX_Merge panics in proto v1.4.0. Use proto.Merge instead of
103  XXX_Merge.
104* spannertest: handle list parameters in RPC interfacea.
105
106## v1.5.0
107
108* Metrics
109  - Instrument client library with adding OpenCensus metrics. This allows for
110    better monitoring of the session pool.
111* Session management
112  - Switch the session keepalive method from GetSession to SELECT 1.
113* Emulator
114  - Use client hooks for admin clients running against an emulator. With
115    this change, users can use SPANNER_EMULATOR_HOST for initializing admin
116    clients when running against an emulator.
117* spansql
118  - Add space between constraint name and foreign key def.
119* Misc
120  - Fix segfault when a non-existent credentials file had been specified.
121  - Fix cleaning up instances in integration tests.
122  - Fix race condition in batch read-only transaction.
123  - Fix the flaky TestLIFOTakeWriteSessionOrder test.
124  - Fix ITs to order results in SELECT queries.
125  - Fix the documentation of timestamp bounds.
126  - Fix the regex issue in managing backups.
127
128## v1.4.0
129
130- Support managed backups. This includes the API methods for CreateBackup,
131  GetBackup, UpdateBackup, DeleteBackup and others. Also includes a simple
132  wrapper in DatabaseAdminClient to create a backup.
133- Update the healthcheck interval. The default interval is updated to 50 mins.
134  By default, the first healthcheck is scheduled between 10 and 55 mins and
135  the subsequent healthchecks are between 45 and 55 mins. This update avoids
136  overloading the backend service with frequent healthchecking.
137
138## v1.3.0
139
140* Query options:
141  - Adds the support of providing query options (optimizer version) via
142    three ways (precedence follows the order):
143    `client-level < environment variables < query-level`. The environment
144    variable is set by "SPANNER_OPTIMIZER_VERSION".
145* Connection pooling:
146  - Use the new connection pooling in gRPC. This change deprecates
147    `ClientConfig.numChannels` and users should move to
148    `WithGRPCConnectionPool(numChannels)` at their earliest convenience.
149    Example:
150    ```go
151    // numChannels (deprecated):
152    err, client := NewClientWithConfig(ctx, database, ClientConfig{NumChannels: 8})
153
154    // gRPC connection pool:
155    err, client := NewClientWithConfig(ctx, database, ClientConfig{}, option.WithGRPCConnectionPool(8))
156    ```
157* Error handling:
158  - Do not rollback after failed commit.
159  - Return TransactionOutcomeUnknownError if a DEADLINE_EXCEEDED or CANCELED
160    error occurs while a COMMIT request is in flight.
161* spansql:
162  - Added support for IN expressions and OFFSET clauses.
163  - Fixed parsing of table constraints.
164  - Added support for foreign key constraints in ALTER TABLE and CREATE TABLE.
165  - Added support for GROUP BY clauses.
166* spannertest:
167  - Added support for IN expressions and OFFSET clauses.
168  - Added support for GROUP BY clauses.
169  - Fixed data race in query execution.
170  - No longer rejects reads specifying an index to use.
171  - Return last commit timestamp as read timestamp when requested.
172  - Evaluate add, subtract, multiply, divide, unary
173    negation, unary not, bitwise and/xor/or operations, as well as reporting
174    column types for expressions involving any possible arithmetic
175    operator.arithmetic expressions.
176  - Fixed handling of descending primary keys.
177* Misc:
178  - Change default healthcheck interval to 30 mins to reduce the GetSession
179    calls made to the backend.
180  - Add marshal/unmarshal json for nullable types to support NullString,
181    NullInt64, NullFloat64, NullBool, NullTime, NullDate.
182  - Use ResourceInfo to extract error.
183  - Extract retry info from status.
184
185## v1.2.1
186
187- Fix session leakage for ApplyAtLeastOnce. Previously session handles where
188  leaked whenever Commit() returned a non-abort, non-session-not-found error,
189  due to a missing recycle() call.
190- Fix error for WriteStruct with pointers. This fixes a specific check for
191  encoding and decoding to pointer types.
192- Fix a GRPCStatus issue that returns a Status that has Unknown code if the
193  base error is nil. Now, it always returns a Status based on Code field of
194  current error.
195
196## v1.2.0
197
198- Support tracking stacktrace of sessionPool.take() that allows the user
199  to instruct the session pool to keep track of the stacktrace of each
200  goroutine that checks out a session from the pool. This is disabled by
201  default, but it can be enabled by setting
202  `SessionPoolConfig.TrackSessionHandles: true`.
203- Add resource-based routing that includes a step to retrieve the
204  instance-specific endpoint before creating the session client when
205  creating a new spanner client. This is disabled by default, but it can
206  be enabled by setting `GOOGLE_CLOUD_SPANNER_ENABLE_RESOURCE_BASED_ROUTING`.
207- Make logger configurable so that the Spanner client can now be configured to
208  use a specific logger instead of the standard logger.
209- Support encoding custom types that point back to supported basic types.
210- Allow decoding Spanner values to custom types that point back to supported
211  types.
212
213## v1.1.0
214
215- The String() method of NullString, NullTime and NullDate will now return
216  an unquoted string instead of a quoted string. This is a BREAKING CHANGE.
217  If you relied on the old behavior, please use fmt.Sprintf("%q", T).
218- The Spanner client will now use the new BatchCreateSessions RPC to initialize
219  the session pool. This will improve the startup time of clients that are
220  initialized with a minimum number of sessions greater than zero
221  (i.e. SessionPoolConfig.MinOpened>0).
222- Spanner clients that are created with the NewClient method will now default
223  to a minimum of 100 opened sessions in the pool
224  (i.e. SessionPoolConfig.MinOpened=100). This will improve the performance
225  of the first transaction/query that is executed by an application, as a
226  session will normally not have to be created as part of the transaction.
227  Spanner clients that are created with the NewClientWithConfig method are
228  not affected by this change.
229- Spanner clients that are created with the NewClient method will now default
230  to a write sessions fraction of 0.2 in the pool
231  (i.e. SessionPoolConfig.WriteSessions=0.2).
232  Spanner clients that are created with the NewClientWithConfig method are
233  not affected by this change.
234- The session pool maintenance worker has been improved so it keeps better
235  track of the actual number of sessions needed. It will now less often delete
236  and re-create sessions. This can improve the overall performance of
237  applications with a low transaction rate.
238
239## v1.0.0
240
241This is the first tag to carve out spanner as its own module. See:
242https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository.
243