Hello Marius, Unfortunately with current PDO state this is not possible to be done in a nice way. Now PDO have defined just these field types: PDO::PARAM_BOOL, PDO::PARAM_INT, PDO::PARAM_STR, PDO::PARAM_LOB, PDO::PARAM_NULL. Last one is “wrong” and should be removed. NULL is a state, not a type or a value. See #73852 bug. So PDO should be extended with at least PDO::PARAM_FLOAT to add floats/double mapping. It needs an RFC to be extended. In plans is to add yet for booleans, Firebird3 bool data type.
- Dorin Marcoci From: marius adrian popa [mailto:[email protected]] Sent: Tuesday, January 10, 2017 3:33 PM To: Dorin Marcoci <[email protected]> Cc: Anatol Belski <[email protected]>; Adam Baratz <[email protected]>; PHP Developers Mailing List <[email protected]> Subject: Re: [PHP-DEV] Dorin Marcoci Added Firebrid native type mapping for integers (smallint, integer, bigint) in PDO_Firebird driver Could you add also type mapping for float , double ... On Fri, Jan 6, 2017 at 9:23 PM, Dorin Marcoci <mailto:[email protected]> wrote: Yep, setting this flag, integers became strings, so all OK, we have a toggle. A nice weekend to all! :) -----Original Message----- From: Anatol Belski [mailto:mailto:[email protected]] Sent: Friday, January 6, 2017 9:13 PM To: 'Adam Baratz' <mailto:[email protected]>; 'marius adrian popa' <mailto:[email protected]> Cc: 'PHP Developers Mailing List' <mailto:[email protected]>; 'Dorin Marcoci' <mailto:[email protected]> Subject: RE: [PHP-DEV] Dorin Marcoci Added Firebrid native type mapping for integers (smallint, integer, bigint) in PDO_Firebird driver Hi, > -----Original Message----- > From: Adam Baratz [mailto:mailto:[email protected]] > Sent: Friday, January 6, 2017 7:59 PM > To: marius adrian popa <mailto:[email protected]> > Cc: PHP Developers Mailing List <mailto:[email protected]> > Subject: Re: [PHP-DEV] Dorin Marcoci Added Firebrid native type > mapping for integers (smallint, integer, bigint) in PDO_Firebird > driver > > > > > <https://github.com/madorin/php-src/tree/fb_native>Firebrid > > native type mapping for integers (smallint, integer, bigint) in > > PDO_Firebird driver > > > It looks like this is an "always on" feature. There's a PDO attribute, > PDO::ATTR_STRINGIFY_FETCHES, that's intended to allow toggling. Since > this is a functionality change, I'd suggest supporting it. It'll make > it easier for users to migrate if they have any baked-in assumptions around > getting strings back. > Good catch. Dorin, would you be up to implement this please? Thanks Anatol -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php
