Skip to content

Conversation

nils
Copy link
Contributor

@nils nils commented Aug 12, 2025

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 nils changed the title Fix: date input conversion fix: date input conversion Aug 12, 2025
@nils nils marked this pull request as ready for review August 12, 2025 08:34
// The following allows passing in ISO strings with non-zulu
// timezones and converts them into zulu dates and times
Date: e => e === '?' ? e : `strftime('%Y-%m-%d',${e})`,
Date: e => `strftime('%Y-%m-%d',${e})`,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Would the other InputConverters need the same adjustment?

@nils
Copy link
Contributor Author

nils commented Aug 12, 2025

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

@patricebender
Copy link
Member

patricebender commented Aug 12, 2025

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)

@nils
Copy link
Contributor Author

nils commented Aug 12, 2025

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

@nils
Copy link
Contributor Author

nils commented Aug 14, 2025

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

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.

Missing DateTime to Date conversion during UPDATE with SQLite

2 participants