cap-js / cds-dbs

Monorepo for SQL Database Services for CAP
https://cap.cloud.sap/docs/
Apache License 2.0
37 stars 11 forks source link

fix(deep): prevent false unique constraint errors and combine delete queries #781

Closed David-Kunz closed 2 months ago

David-Kunz commented 3 months ago
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'}
]
})