Skip to content
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(deep): prevent false unique constraint errors and combine delete queries #781

Merged
merged 49 commits into from
Sep 3, 2024

Conversation

David-Kunz
Copy link
Contributor

@David-Kunz David-Kunz commented Aug 21, 2024

entity Foo : cuid {
  name: String @asser.unique;
}

existing: Foo( ID: 1, name: "foo" )

DELETE: Foo( ID: 3, name: "bar" ) <-- can never fail
UPDATE: Foo( ID: 1, name: "bar" ) <-- can prevent fail
INSERT: Foo( ID: 2, name: "foo" )

possible test:

@odata.draft.enabled
Books {
key ID: Integer
title: localized String;
}
UPDATE(Books, 42).data({
texts: [
{locale: 'en', title: 'abc'}
{locale: 'de', title: 'abc'}
]
})

@David-Kunz David-Kunz changed the title fix(deep): prevent false unique constraint errors fix(deep): prevent false unique constraint errors and combine delete queries Aug 29, 2024
@David-Kunz David-Kunz enabled auto-merge (squash) September 2, 2024 23:55
@@ -2,6 +2,8 @@ const cds = require('@sap/cds')
const { _target_name4 } = require('./SQLService')
const InsertResult = require('../lib/InsertResults')
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const InsertResult = require('../lib/InsertResults')

@David-Kunz David-Kunz merged commit 01de95f into main Sep 3, 2024
4 checks passed
@David-Kunz David-Kunz deleted the no-false-unique-constraint-errors branch September 3, 2024 11:42
@cap-bots cap-bots mentioned this pull request Sep 3, 2024
johannes-vogel pushed a commit that referenced this pull request Sep 4, 2024
🤖 I have created a release *beep* *boop*
---


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

##
[1.12.1](db-service-v1.12.0...db-service-v1.12.1)
(2024-09-03)


### Fixed

* deep `groupby` expand queries
([#768](#768))
([5423cf3](5423cf3))
* **deep:** prevent false unique constraint errors and combine delete
queries ([#781](#781))
([01de95f](01de95f))
* **logging:** from changes in @sap/cds
([#791](#791))
([1e8bf06](1e8bf06))
* prepend aliases to refs within function args in on conditions
([#795](#795))
([9b34314](9b34314)),
closes [#779](#779)
* prevent $search queries from throwing
([#772](#772))
([cdf4d37](cdf4d37))
</details>

<details><summary>hana: 1.2.0</summary>

##
[1.2.0](hana-v1.1.1...hana-v1.2.0)
(2024-09-03)


### Added

* wrap client if @dynatrace/oneagent-sdk is present
([#777](#777))
([147b88e](147b88e))


### Fixed

* Add `{list:[{val}]}` json function support
([#784](#784))
([ce5f856](ce5f856))
* Allow applications to configure `acquireTimeoutMillis`
([#796](#796))
([abac818](abac818))
* deep `groupby` expand queries
([#768](#768))
([5423cf3](5423cf3))
* Enforce `LargeStrings` to be `Strings` for `sql_simple_queries=1`
([#774](#774))
([c38a9e6](c38a9e6))
* wrong falsy checks for vals in list optimization
([#797](#797))
([e818da8](e818da8))


### Changed

* requires @sap/cds &gt;= 8.2
([#789](#789))
([3bbde18](3bbde18))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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.

4 participants