You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

old-news.md 16 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596
  1. _October 30, 2017_
  2. *v0.16.0*
  3. - Other bigquery changes:
  4. - `JobIterator.Next` returns `*Job`; removed `JobInfo` (BREAKING CHANGE).
  5. - UseStandardSQL is deprecated; set UseLegacySQL to true if you need
  6. Legacy SQL.
  7. - Uploader.Put will generate a random insert ID if you do not provide one.
  8. - Support time partitioning for load jobs.
  9. - Support dry-run queries.
  10. - A `Job` remembers its last retrieved status.
  11. - Support retrieving job configuration.
  12. - Support labels for jobs and tables.
  13. - Support dataset access lists.
  14. - Improve support for external data sources, including data from Bigtable and
  15. Google Sheets, and tables with external data.
  16. - Support updating a table's view configuration.
  17. - Fix uploading civil times with nanoseconds.
  18. - storage:
  19. - Support PubSub notifications.
  20. - Support Requester Pays buckets.
  21. - profiler: Support goroutine and mutex profile types.
  22. _October 3, 2017_
  23. *v0.15.0*
  24. - firestore: beta release. See the
  25. [announcement](https://firebase.googleblog.com/2017/10/introducing-cloud-firestore.html).
  26. - errorreporting: The existing package has been redesigned.
  27. - errors: This package has been removed. Use errorreporting.
  28. _September 28, 2017_
  29. *v0.14.0*
  30. - bigquery BREAKING CHANGES:
  31. - Standard SQL is the default for queries and views.
  32. - `Table.Create` takes `TableMetadata` as a second argument, instead of
  33. options.
  34. - `Dataset.Create` takes `DatasetMetadata` as a second argument.
  35. - `DatasetMetadata` field `ID` renamed to `FullID`
  36. - `TableMetadata` field `ID` renamed to `FullID`
  37. - Other bigquery changes:
  38. - The client will append a random suffix to a provided job ID if you set
  39. `AddJobIDSuffix` to true in a job config.
  40. - Listing jobs is supported.
  41. - Better retry logic.
  42. - vision, language, speech: clients are now stable
  43. - monitoring: client is now beta
  44. - profiler:
  45. - Rename InstanceName to Instance, ZoneName to Zone
  46. - Auto-detect service name and version on AppEngine.
  47. _September 8, 2017_
  48. *v0.13.0*
  49. - bigquery: UseLegacySQL options for CreateTable and QueryConfig. Use these
  50. options to continue using Legacy SQL after the client switches its default
  51. to Standard SQL.
  52. - bigquery: Support for updating dataset labels.
  53. - bigquery: Set DatasetIterator.ProjectID to list datasets in a project other
  54. than the client's. DatasetsInProject is no longer needed and is deprecated.
  55. - bigtable: Fail ListInstances when any zones fail.
  56. - spanner: support decoding of slices of basic types (e.g. []string, []int64,
  57. etc.)
  58. - logging/logadmin: UpdateSink no longer creates a sink if it is missing
  59. (actually a change to the underlying service, not the client)
  60. - profiler: Service and ServiceVersion replace Target in Config.
  61. _August 22, 2017_
  62. *v0.12.0*
  63. - pubsub: Subscription.Receive now uses streaming pull.
  64. - pubsub: add Client.TopicInProject to access topics in a different project
  65. than the client.
  66. - errors: renamed errorreporting. The errors package will be removed shortly.
  67. - datastore: improved retry behavior.
  68. - bigquery: support updates to dataset metadata, with etags.
  69. - bigquery: add etag support to Table.Update (BREAKING: etag argument added).
  70. - bigquery: generate all job IDs on the client.
  71. - storage: support bucket lifecycle configurations.
  72. _July 31, 2017_
  73. *v0.11.0*
  74. - Clients for spanner, pubsub and video are now in beta.
  75. - New client for DLP.
  76. - spanner: performance and testing improvements.
  77. - storage: requester-pays buckets are supported.
  78. - storage, profiler, bigtable, bigquery: bug fixes and other minor improvements.
  79. - pubsub: bug fixes and other minor improvements
  80. _June 17, 2017_
  81. *v0.10.0*
  82. - pubsub: Subscription.ModifyPushConfig replaced with Subscription.Update.
  83. - pubsub: Subscription.Receive now runs concurrently for higher throughput.
  84. - vision: cloud.google.com/go/vision is deprecated. Use
  85. cloud.google.com/go/vision/apiv1 instead.
  86. - translation: now stable.
  87. - trace: several changes to the surface. See the link below.
  88. [Code changes required from v0.9.0.](https://github.com/GoogleCloudPlatform/google-cloud-go/blob/master/MIGRATION.md)
  89. _March 17, 2017_
  90. Breaking Pubsub changes.
  91. * Publish is now asynchronous
  92. ([announcement](https://groups.google.com/d/topic/google-api-go-announce/aaqRDIQ3rvU/discussion)).
  93. * Subscription.Pull replaced by Subscription.Receive, which takes a callback ([announcement](https://groups.google.com/d/topic/google-api-go-announce/8pt6oetAdKc/discussion)).
  94. * Message.Done replaced with Message.Ack and Message.Nack.
  95. _February 14, 2017_
  96. Release of a client library for Spanner. See
  97. the
  98. [blog post](https://cloudplatform.googleblog.com/2017/02/introducing-Cloud-Spanner-a-global-database-service-for-mission-critical-applications.html).
  99. Note that although the Spanner service is beta, the Go client library is alpha.
  100. _December 12, 2016_
  101. Beta release of BigQuery, DataStore, Logging and Storage. See the
  102. [blog post](https://cloudplatform.googleblog.com/2016/12/announcing-new-google-cloud-client.html).
  103. Also, BigQuery now supports structs. Read a row directly into a struct with
  104. `RowIterator.Next`, and upload a row directly from a struct with `Uploader.Put`.
  105. You can also use field tags. See the [package documentation][cloud-bigquery-ref]
  106. for details.
  107. _December 5, 2016_
  108. More changes to BigQuery:
  109. * The `ValueList` type was removed. It is no longer necessary. Instead of
  110. ```go
  111. var v ValueList
  112. ... it.Next(&v) ..
  113. ```
  114. use
  115. ```go
  116. var v []Value
  117. ... it.Next(&v) ...
  118. ```
  119. * Previously, repeatedly calling `RowIterator.Next` on the same `[]Value` or
  120. `ValueList` would append to the slice. Now each call resets the size to zero first.
  121. * Schema inference will infer the SQL type BYTES for a struct field of
  122. type []byte. Previously it inferred STRING.
  123. * The types `uint`, `uint64` and `uintptr` are no longer supported in schema
  124. inference. BigQuery's integer type is INT64, and those types may hold values
  125. that are not correctly represented in a 64-bit signed integer.
  126. * The SQL types DATE, TIME and DATETIME are now supported. They correspond to
  127. the `Date`, `Time` and `DateTime` types in the new `cloud.google.com/go/civil`
  128. package.
  129. _November 17, 2016_
  130. Change to BigQuery: values from INTEGER columns will now be returned as int64,
  131. not int. This will avoid errors arising from large values on 32-bit systems.
  132. _November 8, 2016_
  133. New datastore feature: datastore now encodes your nested Go structs as Entity values,
  134. instead of a flattened list of the embedded struct's fields.
  135. This means that you may now have twice-nested slices, eg.
  136. ```go
  137. type State struct {
  138. Cities []struct{
  139. Populations []int
  140. }
  141. }
  142. ```
  143. See [the announcement](https://groups.google.com/forum/#!topic/google-api-go-announce/79jtrdeuJAg) for
  144. more details.
  145. _November 8, 2016_
  146. Breaking changes to datastore: contexts no longer hold namespaces; instead you
  147. must set a key's namespace explicitly. Also, key functions have been changed
  148. and renamed.
  149. * The WithNamespace function has been removed. To specify a namespace in a Query, use the Query.Namespace method:
  150. ```go
  151. q := datastore.NewQuery("Kind").Namespace("ns")
  152. ```
  153. * All the fields of Key are exported. That means you can construct any Key with a struct literal:
  154. ```go
  155. k := &Key{Kind: "Kind", ID: 37, Namespace: "ns"}
  156. ```
  157. * As a result of the above, the Key methods Kind, ID, d.Name, Parent, SetParent and Namespace have been removed.
  158. * `NewIncompleteKey` has been removed, replaced by `IncompleteKey`. Replace
  159. ```go
  160. NewIncompleteKey(ctx, kind, parent)
  161. ```
  162. with
  163. ```go
  164. IncompleteKey(kind, parent)
  165. ```
  166. and if you do use namespaces, make sure you set the namespace on the returned key.
  167. * `NewKey` has been removed, replaced by `NameKey` and `IDKey`. Replace
  168. ```go
  169. NewKey(ctx, kind, name, 0, parent)
  170. NewKey(ctx, kind, "", id, parent)
  171. ```
  172. with
  173. ```go
  174. NameKey(kind, name, parent)
  175. IDKey(kind, id, parent)
  176. ```
  177. and if you do use namespaces, make sure you set the namespace on the returned key.
  178. * The `Done` variable has been removed. Replace `datastore.Done` with `iterator.Done`, from the package `google.golang.org/api/iterator`.
  179. * The `Client.Close` method will have a return type of error. It will return the result of closing the underlying gRPC connection.
  180. See [the announcement](https://groups.google.com/forum/#!topic/google-api-go-announce/hqXtM_4Ix-0) for
  181. more details.
  182. _October 27, 2016_
  183. Breaking change to bigquery: `NewGCSReference` is now a function,
  184. not a method on `Client`.
  185. New bigquery feature: `Table.LoaderFrom` now accepts a `ReaderSource`, enabling
  186. loading data into a table from a file or any `io.Reader`.
  187. _October 21, 2016_
  188. Breaking change to pubsub: removed `pubsub.Done`.
  189. Use `iterator.Done` instead, where `iterator` is the package
  190. `google.golang.org/api/iterator`.
  191. _October 19, 2016_
  192. Breaking changes to cloud.google.com/go/bigquery:
  193. * Client.Table and Client.OpenTable have been removed.
  194. Replace
  195. ```go
  196. client.OpenTable("project", "dataset", "table")
  197. ```
  198. with
  199. ```go
  200. client.DatasetInProject("project", "dataset").Table("table")
  201. ```
  202. * Client.CreateTable has been removed.
  203. Replace
  204. ```go
  205. client.CreateTable(ctx, "project", "dataset", "table")
  206. ```
  207. with
  208. ```go
  209. client.DatasetInProject("project", "dataset").Table("table").Create(ctx)
  210. ```
  211. * Dataset.ListTables have been replaced with Dataset.Tables.
  212. Replace
  213. ```go
  214. tables, err := ds.ListTables(ctx)
  215. ```
  216. with
  217. ```go
  218. it := ds.Tables(ctx)
  219. for {
  220. table, err := it.Next()
  221. if err == iterator.Done {
  222. break
  223. }
  224. if err != nil {
  225. // TODO: Handle error.
  226. }
  227. // TODO: use table.
  228. }
  229. ```
  230. * Client.Read has been replaced with Job.Read, Table.Read and Query.Read.
  231. Replace
  232. ```go
  233. it, err := client.Read(ctx, job)
  234. ```
  235. with
  236. ```go
  237. it, err := job.Read(ctx)
  238. ```
  239. and similarly for reading from tables or queries.
  240. * The iterator returned from the Read methods is now named RowIterator. Its
  241. behavior is closer to the other iterators in these libraries. It no longer
  242. supports the Schema method; see the next item.
  243. Replace
  244. ```go
  245. for it.Next(ctx) {
  246. var vals ValueList
  247. if err := it.Get(&vals); err != nil {
  248. // TODO: Handle error.
  249. }
  250. // TODO: use vals.
  251. }
  252. if err := it.Err(); err != nil {
  253. // TODO: Handle error.
  254. }
  255. ```
  256. with
  257. ```
  258. for {
  259. var vals ValueList
  260. err := it.Next(&vals)
  261. if err == iterator.Done {
  262. break
  263. }
  264. if err != nil {
  265. // TODO: Handle error.
  266. }
  267. // TODO: use vals.
  268. }
  269. ```
  270. Instead of the `RecordsPerRequest(n)` option, write
  271. ```go
  272. it.PageInfo().MaxSize = n
  273. ```
  274. Instead of the `StartIndex(i)` option, write
  275. ```go
  276. it.StartIndex = i
  277. ```
  278. * ValueLoader.Load now takes a Schema in addition to a slice of Values.
  279. Replace
  280. ```go
  281. func (vl *myValueLoader) Load(v []bigquery.Value)
  282. ```
  283. with
  284. ```go
  285. func (vl *myValueLoader) Load(v []bigquery.Value, s bigquery.Schema)
  286. ```
  287. * Table.Patch is replace by Table.Update.
  288. Replace
  289. ```go
  290. p := table.Patch()
  291. p.Description("new description")
  292. metadata, err := p.Apply(ctx)
  293. ```
  294. with
  295. ```go
  296. metadata, err := table.Update(ctx, bigquery.TableMetadataToUpdate{
  297. Description: "new description",
  298. })
  299. ```
  300. * Client.Copy is replaced by separate methods for each of its four functions.
  301. All options have been replaced by struct fields.
  302. * To load data from Google Cloud Storage into a table, use Table.LoaderFrom.
  303. Replace
  304. ```go
  305. client.Copy(ctx, table, gcsRef)
  306. ```
  307. with
  308. ```go
  309. table.LoaderFrom(gcsRef).Run(ctx)
  310. ```
  311. Instead of passing options to Copy, set fields on the Loader:
  312. ```go
  313. loader := table.LoaderFrom(gcsRef)
  314. loader.WriteDisposition = bigquery.WriteTruncate
  315. ```
  316. * To extract data from a table into Google Cloud Storage, use
  317. Table.ExtractorTo. Set fields on the returned Extractor instead of
  318. passing options.
  319. Replace
  320. ```go
  321. client.Copy(ctx, gcsRef, table)
  322. ```
  323. with
  324. ```go
  325. table.ExtractorTo(gcsRef).Run(ctx)
  326. ```
  327. * To copy data into a table from one or more other tables, use
  328. Table.CopierFrom. Set fields on the returned Copier instead of passing options.
  329. Replace
  330. ```go
  331. client.Copy(ctx, dstTable, srcTable)
  332. ```
  333. with
  334. ```go
  335. dst.Table.CopierFrom(srcTable).Run(ctx)
  336. ```
  337. * To start a query job, create a Query and call its Run method. Set fields
  338. on the query instead of passing options.
  339. Replace
  340. ```go
  341. client.Copy(ctx, table, query)
  342. ```
  343. with
  344. ```go
  345. query.Run(ctx)
  346. ```
  347. * Table.NewUploader has been renamed to Table.Uploader. Instead of options,
  348. configure an Uploader by setting its fields.
  349. Replace
  350. ```go
  351. u := table.NewUploader(bigquery.UploadIgnoreUnknownValues())
  352. ```
  353. with
  354. ```go
  355. u := table.NewUploader(bigquery.UploadIgnoreUnknownValues())
  356. u.IgnoreUnknownValues = true
  357. ```
  358. _October 10, 2016_
  359. Breaking changes to cloud.google.com/go/storage:
  360. * AdminClient replaced by methods on Client.
  361. Replace
  362. ```go
  363. adminClient.CreateBucket(ctx, bucketName, attrs)
  364. ```
  365. with
  366. ```go
  367. client.Bucket(bucketName).Create(ctx, projectID, attrs)
  368. ```
  369. * BucketHandle.List replaced by BucketHandle.Objects.
  370. Replace
  371. ```go
  372. for query != nil {
  373. objs, err := bucket.List(d.ctx, query)
  374. if err != nil { ... }
  375. query = objs.Next
  376. for _, obj := range objs.Results {
  377. fmt.Println(obj)
  378. }
  379. }
  380. ```
  381. with
  382. ```go
  383. iter := bucket.Objects(d.ctx, query)
  384. for {
  385. obj, err := iter.Next()
  386. if err == iterator.Done {
  387. break
  388. }
  389. if err != nil { ... }
  390. fmt.Println(obj)
  391. }
  392. ```
  393. (The `iterator` package is at `google.golang.org/api/iterator`.)
  394. Replace `Query.Cursor` with `ObjectIterator.PageInfo().Token`.
  395. Replace `Query.MaxResults` with `ObjectIterator.PageInfo().MaxSize`.
  396. * ObjectHandle.CopyTo replaced by ObjectHandle.CopierFrom.
  397. Replace
  398. ```go
  399. attrs, err := src.CopyTo(ctx, dst, nil)
  400. ```
  401. with
  402. ```go
  403. attrs, err := dst.CopierFrom(src).Run(ctx)
  404. ```
  405. Replace
  406. ```go
  407. attrs, err := src.CopyTo(ctx, dst, &storage.ObjectAttrs{ContextType: "text/html"})
  408. ```
  409. with
  410. ```go
  411. c := dst.CopierFrom(src)
  412. c.ContextType = "text/html"
  413. attrs, err := c.Run(ctx)
  414. ```
  415. * ObjectHandle.ComposeFrom replaced by ObjectHandle.ComposerFrom.
  416. Replace
  417. ```go
  418. attrs, err := dst.ComposeFrom(ctx, []*storage.ObjectHandle{src1, src2}, nil)
  419. ```
  420. with
  421. ```go
  422. attrs, err := dst.ComposerFrom(src1, src2).Run(ctx)
  423. ```
  424. * ObjectHandle.Update's ObjectAttrs argument replaced by ObjectAttrsToUpdate.
  425. Replace
  426. ```go
  427. attrs, err := obj.Update(ctx, &storage.ObjectAttrs{ContextType: "text/html"})
  428. ```
  429. with
  430. ```go
  431. attrs, err := obj.Update(ctx, storage.ObjectAttrsToUpdate{ContextType: "text/html"})
  432. ```
  433. * ObjectHandle.WithConditions replaced by ObjectHandle.If.
  434. Replace
  435. ```go
  436. obj.WithConditions(storage.Generation(gen), storage.IfMetaGenerationMatch(mgen))
  437. ```
  438. with
  439. ```go
  440. obj.Generation(gen).If(storage.Conditions{MetagenerationMatch: mgen})
  441. ```
  442. Replace
  443. ```go
  444. obj.WithConditions(storage.IfGenerationMatch(0))
  445. ```
  446. with
  447. ```go
  448. obj.If(storage.Conditions{DoesNotExist: true})
  449. ```
  450. * `storage.Done` replaced by `iterator.Done` (from package `google.golang.org/api/iterator`).
  451. _October 6, 2016_
  452. Package preview/logging deleted. Use logging instead.
  453. _September 27, 2016_
  454. Logging client replaced with preview version (see below).
  455. _September 8, 2016_
  456. * New clients for some of Google's Machine Learning APIs: Vision, Speech, and
  457. Natural Language.
  458. * Preview version of a new [Stackdriver Logging][cloud-logging] client in
  459. [`cloud.google.com/go/preview/logging`](https://godoc.org/cloud.google.com/go/preview/logging).
  460. This client uses gRPC as its transport layer, and supports log reading, sinks
  461. and metrics. It will replace the current client at `cloud.google.com/go/logging` shortly.