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

test: post processing with custom join #480

Merged
merged 7 commits into from
Feb 29, 2024
Merged

test: post processing with custom join #480

merged 7 commits into from
Feb 29, 2024

Conversation

patricebender
Copy link
Member

No description provided.

@@ -21,6 +21,7 @@ entity Authors : managed {
dateOfDeath : Date;
Copy link
Contributor

Choose a reason for hiding this comment

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

Date type has an output converter.
If you want to check every type. It is possible to use the compliance model, but you will need to define a non sense join condition.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd propose to simply use validate the date output instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

forget my comment, the date type is already sanitized on insert.

Copy link
Contributor

Choose a reason for hiding this comment

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

I've added a where clause for the join to identify the right entry

Copy link
Member Author

Choose a reason for hiding this comment

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

is it okay for you guys to just check the boolean?

Copy link
Contributor

Choose a reason for hiding this comment

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

cds.Date gets translated into an cds.Timestamp format for storage and is then converted back into an cds.Date format using the output converter. Additionally cds.Boolean doesn't always have an output converter. While cds.Date always has one for all current database services.

I can take over the PR if that is prefered @patricebender

Copy link
Contributor

Choose a reason for hiding this comment

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

for cds.date we have input converters that ensure YY-MM-DD format:

Date: e => `strftime('%Y-%m-%d',${e})`,
, we'd need a plain sql insert to ensure the output converter really kicks in.

Copy link
Member Author

Choose a reason for hiding this comment

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

I can take over the PR if that is prefered @patricebender

fine by me. :)


the reason why we came up with this was that we wanted to check whether there is a better place for the "hack" implemented in #469

@patricebender patricebender enabled auto-merge (squash) February 29, 2024 10:43
@patricebender patricebender merged commit c5cf383 into main Feb 29, 2024
4 checks passed
@patricebender patricebender deleted the join-test branch February 29, 2024 13:36
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.

3 participants