Skip to content
This repository has been archived by the owner on Jul 14, 2023. It is now read-only.

fix: support deep update for one to many composition #281

Merged
merged 2 commits into from
Mar 19, 2022

Conversation

sebastianesch
Copy link
Contributor

@sebastianesch sebastianesch commented Mar 19, 2022

Hi @vobu & @gregorwolf

This pull request fixes the test for deep update that was marked as skip in service.test.js.

During a deep update, CAP deletes in this scenario all Beers, updates the Brewery and then inserts the Beers from the payload. In this case the "values" passed as parameter to the PostgreSQL client is an array of arrays containing the values. That lead to the error message "bind message supplies 1 parameters, but prepared statement "" requires 9".

This is handled correctly in executeInsertCQN, but CAP is in an update context - therefore the executeGenericCQN function is called. The fix is to reroute to executeInsertCQN if the SQL is an insert query.

I also had to modify the deep update service test in order to restore the number of beers for the local-schema test.

I think this should also address the issue #116.

Cheers,
Sebastian

@gregorwolf gregorwolf merged commit 5e9e124 into sapmentors:main Mar 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants