cds-dbs icon indicating copy to clipboard operation
cds-dbs copied to clipboard

fix: date input conversion

Open nils opened this issue 5 months ago • 4 comments

This is an attempt to fix #1002. I'm not sure though if this is the right approach, maybe there was a reason I don't understand for the condition (e => e === '?' ? e) that I have removed.

The new testcase fails without the adjustment.

With the fix, the following SQL will be executed:

> await db.run(UPDATE('basic.literals.date').set({date: new Date()}))
[sql] - BEGIN
[sql] - UPDATE basic_literals_date AS "$d" SET date=strftime('%Y-%m-%d',?) [ '2025-08-12T08:32:45.882Z' ]
[sql] - COMMIT

Before the fix, it was like this:

> await db.run(UPDATE('basic.literals.date').set({date: new Date()}))
[sql] - BEGIN
[sql] - UPDATE basic_literals_date AS "$d" SET date=? [ '2025-08-12T08:33:43.387Z' ]
[sql] - COMMIT

nils avatar Aug 12 '25 08:08 nils

Strange, I see that the tests are failing in the pipeline... I'll check, they are running fine locally.

nils avatar Aug 12 '25 09:08 nils

Strange, I see that the tests are failing in the pipeline... I'll check, they are running fine locally.

SQlite tests are fine, looks like PG and HANA do behave differently though (compliance test suite is run against all DBs)

patricebender avatar Aug 12 '25 09:08 patricebender

@patricebender Postgres looks fine locally now, but I have some trouble running the HANA testcases locally. Could you please approve another workflow run?

nils avatar Aug 12 '25 11:08 nils

Testcases look good now! I think this is ready for review.

nils avatar Aug 14 '25 15:08 nils