Giter Club home page Giter Club logo

Comments (4)

kripper avatar kripper commented on July 24, 2024

Hi @jakubmisek, do you know if it's possible to mimic Zend's PDO behavaiour, ie. to allow the PDO driver to accept string parameters for querying integer and numeric fields?

from peachpie.

kripper avatar kripper commented on July 24, 2024

Hi @jakubmisek, any chance to take a look at this problem?

IMO this is a design problem that we should address the sooner the better.
How have you dealt with this problem with the other DB backends?

Key here is "most of the time we will fetch values and use them as parameters in subsequent queries".

from peachpie.

jakubmisek avatar jakubmisek commented on July 24, 2024

@kripper thank you for reporting the issue. I'd need a test case to try that;

from peachpie.

kripper avatar kripper commented on July 24, 2024

Hi, the problem was that PeachPie's PDO doesn't support providing a string with an integer ("123") as a nummeric argument (i.e. an argument that is expected to be a number, like in SELECT 1 = ?), while Zend supports it.
But on the other hand, Zend's PDO doesn't support providing a float (123.456) nor a string containing a float ("123.456") as a nummeric argument. This is really frustrating, since it forces to rewrite SQL sentences to include CASTs.
Since Zend is broken for floats, I'm not sure if it is worth fixing this problem only for integers...unless we accept to fix both cases in PeachPie even when it probably won't be fixed on Zend.
Closing for now.

from peachpie.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.