-
Notifications
You must be signed in to change notification settings - Fork 14
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
feat: support HANA stored procedures #542
Conversation
hana/test/run.test.js
Outdated
await createProcedures() | ||
}) | ||
|
||
describe('with dynatrace', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't have dynatrace
hana/test/package.json
Outdated
@@ -0,0 +1,5 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file should not exist. The test/cds.js
file has to add the @cap-js/hana
credentials.
hana/test/run.test.js
Outdated
CREATE PROCEDURE "procTest0" ( OUT TEST_1 TABLE ( TEST_1_COL_1 NVARCHAR(32) ), OUT TEST_2 NVARCHAR(32) ) AS | ||
BEGIN TEST_1 = SELECT '1' AS TEST_1_COL_1 FROM DUMMY; TEST_2 = '2'; END`) | ||
} catch (e) { | ||
if (e.message.match(/cannot use duplicate name of function or procedure/)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the error code as this is uniformly send from HANA directly.
hana/test/run.test.js
Outdated
|
||
async function createProcedures() { | ||
try { | ||
await cds.run(` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just put all the procedures into an array and loop over them.
hana/test/run.test.js
Outdated
await cds.run(INSERT.into('SAP_CAPIRE_TESTENTITY').columns(['ID', 'title']).rows([3, '3'])) | ||
await cds.run(INSERT.into('SAP_CAPIRE_TESTENTITY').columns(['ID', 'title']).rows([4, '4'])) | ||
} catch (e) { | ||
// ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better notice when the data does not actually exist instead of having all tests fail with strange expectations.
hana/test/run.test.js
Outdated
expect(res).toEqual(exp) | ||
res = await cds.run(`CALL PROC_TEST_4(?,?,?,?)`, [0, 2]) | ||
expect(res).toEqual(exp) | ||
// REVISIT order of OUT parameters does not match positions in stored procedure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this matter ?
Co-authored-by: Bob den Os <108393871+BobdenOs@users.noreply.github.com>
🤖 I have created a release *beep* *boop* --- <details><summary>db-service: 1.8.0</summary> ## [1.8.0](db-service-v1.7.0...db-service-v1.8.0) (2024-04-12) ### Added * Odata built-in query functions ([#558](#558)) ([6e63367](6e63367)) * support HANA stored procedures ([#542](#542)) ([52a00a0](52a00a0)) ### Fixed * **`expand`:** Only accept on structures, assocs or table aliases ([#551](#551)) ([3248512](3248512)) * **`order by`:** for localized sorting, prepend table alias ([#546](#546)) ([a273a92](a273a92)) * etag with stream_compat ([#562](#562)) ([b0a3a41](b0a3a41)) * exclude `cds.LargeBinary` from wildcard expansion ([#577](#577)) ([6661d63](6661d63)) * Reduce insert queries for deep update ([#568](#568)) ([55e5114](55e5114)) * Reduced count query complexity when possible ([#553](#553)) ([3331f02](3331f02)) </details> <details><summary>postgres: 1.7.0</summary> ## [1.7.0](postgres-v1.6.0...postgres-v1.7.0) (2024-04-12) ### Added * Odata built-in query functions ([#558](#558)) ([6e63367](6e63367)) </details> <details><summary>hana: 0.2.0</summary> ## [0.2.0](hana-v0.1.0...hana-v0.2.0) (2024-04-12) ### Added * Odata built-in query functions ([#558](#558)) ([6e63367](6e63367)) * support HANA stored procedures ([#542](#542)) ([52a00a0](52a00a0)) </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: Johannes Vogel <31311694+johannes-vogel@users.noreply.github.com>
No description provided.