cap-js / cds-types

Type definitions for CDS
Apache License 2.0
10 stars 10 forks source link

support locks in cqn #331

Open qby-ankul opened 4 days ago

qby-ankul commented 4 days ago

currently locks are not supported in cqn

https://github.com/cap-js/cds-types/blob/432f34b492eb7a02a222411efad687a44fa6e17c/apis/cqn.d.ts#L10

see docu: https://cap.cloud.sap/docs/cds/cqn#select

daogrady commented 3 days ago

Hi @qby-ankul ,

thanks for pointing out these missing properties! They will be included with the next release.

Best, Daniel

qby-ankul commented 3 days ago

Hi @daogrady

thank you. The ‘for update ignore locked’ statement is currently not supported by CQN, is that correct?

daogrady commented 3 days ago

Hi @qby-ankul ,

I don't think I fully understand the question. Can you please elaborate?

Best, Daniel

qby-ankul commented 3 days ago

Hi @daogrady

if you check, for example, the following link: https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-sql-reference-guide/select-statement-data-manipulation#loio20fcf24075191014a89e9dc7b8408b26__for_update_clause

FOR UPDATE [ OF <update_column_name_list> ] [ { <wait_nowait> | **IGNORE LOCKED** } ]

Does the SQL statement have other options, including ignore locked. In CQN I miss this part at the moment, either because it is not available or not documented.

daogrady commented 3 days ago

Hi @qby-ankul ,

I'm afraid this is beyond my competence. @patricebender this seems like the question is related to cds-dbs. Could you please weigh in here?

Best, Daniel

patricebender commented 2 days ago

Hi @daogrady

if you check, for example, the following link: https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-sql-reference-guide/select-statement-data-manipulation#loio20fcf24075191014a89e9dc7b8408b26__for_update_clause

FOR UPDATE [ OF <update_column_name_list> ] [ { <wait_nowait> | **IGNORE LOCKED** } ]

Does the SQL statement have other options, including ignore locked. In CQN I miss this part at the moment, either because it is not available or not documented.

@johannes-vogel could you jump in here and say something about the FOR UPDATE properties?

qby-ankul commented 2 days ago

If I see this right, only the ignore locked is not implemented.

https://github.com/cap-js/cds-dbs/blob/main/db-service/lib/cqn2sql.js#L447

or better at this point, : https://github.com/cap-js/cds-dbs/blob/main/hana/lib/HANAService.js#L137 because it is called differently in pgsql https://www.postgresql.org/docs/current/sql-select.html : SKIP LOCKED