-
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
test: post processing with custom join #480
Conversation
2af380e
to
b479340
Compare
test/bookshop/db/schema.cds
Outdated
@@ -21,6 +21,7 @@ entity Authors : managed { | |||
dateOfDeath : Date; |
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.
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.
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.
I'd propose to simply use validate the date output instead.
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.
forget my comment, the date type is already sanitized on insert.
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.
I've added a where clause for the join to identify the right entry
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.
is it okay for you guys to just check the boolean?
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.
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
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.
for cds.date we have input converters that ensure YY-MM-DD
format:
cds-dbs/sqlite/lib/SQLiteService.js
Line 180 in 2580c24
Date: e => `strftime('%Y-%m-%d',${e})`, |
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.
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
No description provided.