Skip to content

Conversation

@BobdenOs
Copy link
Contributor

@BobdenOs BobdenOs commented May 7, 2025

fix: #1168

value.pipe(paramStream)
value.on('error', err => paramStream.emit('error', err))
streams[i] = paramStream
streams.push(paramStream)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you elaborate why this solves the issue of having undefined values in the streams array? If paramStream is undefined wouldn't both arrays contain the undefined value?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The paramStream is always initialized inside this branch of the logic. The problem happens in the loop which goes over the streams when using the [i] assignment the array length is set to i which means that if it is not i === stream.lenght + 1 then inside the loop there will be entries which are undefined. By using push the array won't add empty entries which should fix the loop.

@johannes-vogel johannes-vogel enabled auto-merge (squash) May 26, 2025 11:23
@johannes-vogel johannes-vogel merged commit 7ee8083 into main May 26, 2025
6 of 7 checks passed
@johannes-vogel johannes-vogel deleted the fix/pg-stream-params branch May 26, 2025 11:30
@cap-bots cap-bots mentioned this pull request May 26, 2025
johannes-vogel added a commit that referenced this pull request May 28, 2025
🤖 I have created a release *beep* *boop*
---


<details><summary>db-service: 2.0.1</summary>

##
[2.0.1](db-service-v2.0.0...db-service-v2.0.1)
(2025-05-27)


### Fixed

* **`search`:** do not search on non-projected elements
([#1198](#1198))
([73d9e67](73d9e67))
* add shortcut for empty UPDATE.data
([#1203](#1203))
([cf991ff](cf991ff))
* hierarchies in quoted mode
([3465cba](3465cba))
* only sort by locale if locale is set
([#1193](#1193))
([3465cba](3465cba))


### Changed

* remove stream_compat
([#1139](#1139))
([#1144](#1144))
([1b8b2d9](1b8b2d9))
</details>

<details><summary>sqlite: 2.0.1</summary>

##
[2.0.1](sqlite-v2.0.0...sqlite-v2.0.1)
(2025-05-27)


### Changed

* remove stream_compat
([#1139](#1139))
([#1144](#1144))
([1b8b2d9](1b8b2d9))
</details>

<details><summary>postgres: 2.0.1</summary>

##
[2.0.1](postgres-v2.0.0...postgres-v2.0.1)
(2025-05-27)


### Fixed

* Enable mixing stream and normal parameters in queries
([#1179](#1179))
([7ee8083](7ee8083))
* hierarchies in quoted mode
([3465cba](3465cba))
* only sort by locale if locale is set
([#1193](#1193))
([3465cba](3465cba))


### Changed

* remove PG `?` placeholder replacement
([#1180](#1180))
([a1e0bd9](a1e0bd9))
* remove stream_compat
([#1139](#1139))
([#1144](#1144))
([1b8b2d9](1b8b2d9))
</details>

<details><summary>hana: 2.0.1</summary>

##
[2.0.1](hana-v2.0.0...hana-v2.0.1)
(2025-05-27)


### Added

* set NOW as session var in addition to $now
([#1201](#1201))
([33d4814](33d4814))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: D045778 <johannes.vogel@sap.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Activation of Avatar draft image fails with postgresql Backend; Potential solution found (see comment)

4 participants