Skip to content

Handle dates specifically #2341

Open
Open
@Yopai

Description

@Yopai

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions