-
Notifications
You must be signed in to change notification settings - Fork 102
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
fix!: return API objects in streams #967
base: main
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #967 +/- ##
========================================
Coverage 98.60% 98.60%
========================================
Files 23 23
Lines 21923 21974 +51
Branches 1226 1102 -124
========================================
+ Hits 21617 21668 +51
Misses 297 297
Partials 9 9
Continue to review full report at Codecov.
|
@olavloite since you've been looking into streams recently, would you be able to help review this? |
@AVaksman Do I understand this correctly that the main feature change here is that these streams will now emit the data as Spanner (rich) client classes (e.g. |
src/database.ts
Outdated
) { | ||
const session = self.session(chunk.name!); | ||
session.metadata = chunk; | ||
this.push(session); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe callback(null, session)
would be our usual pattern.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems neater.
Thanks!
Yes, as streaming methods should emit same data as their callback cousins.
I believe this was missed in the previous PR #925 and this PR fixes it. The documentation also sights the emitted data as Spanner (rich) client classes * @returns {ReadableStream} A readable stream that emits {@link Session}
* instances.
---------------
* @returns {ReadableStream} A readable stream that emits {@link Instance}
* instances.
---------------
* @returns {ReadableStream} A readable stream that emits {@link Backup}
* instances.
---------------
* @returns {ReadableStream} A readable stream that emits {@link Database}
* instances. |
I would still call this breaking :( User code that worked will not work after this release. |
Adjusted the PR header |
d81ca44
to
fb530ee
Compare
3e55263
to
79d0b6f
Compare
@AVaksman @stephenplusplus @skuruppu this PR is looking a little moldy :) What's the plan here? |
Just waiting for the next major release. |
The next major release will come in around a month's time. We're just gathering up all the breaking changes :) |
Convert objects returned by streams to API objects.