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

Handle dates specifically #2341

Open
Yopai opened this issue Feb 4, 2025 · 0 comments
Open

Handle dates specifically #2341

Yopai opened this issue Feb 4, 2025 · 0 comments

Comments

@Yopai
Copy link

Yopai commented Feb 4, 2025

Hi,

=== Context
Phinx :) for this work.

I'm writing an Adapter for PDO-OCI.

I'm getting blocked by some things that should be fixed in.

=== Observed behaviour
The PDOAdapter generates the query with date formatted as string. Oracle generates an ORA-01843 error (invalid month).
Setting NLS_DATE_FORMAT has no effect (it may be related to the Oracle version)

== Proposed behaviour
As done for boolean, use a "castDate" method. Which would, for others, use the string as is. And could be overriden in OCIAdapter to encapsulate the string in a "TO_DATE".

Another way to do it, probably better, would be used parametrized queries.

(For now, I have overriden the migrated method in OCI-Adapter, I will push a PR when I'll find some time)

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

No branches or pull requests

1 participant