RE: [PEAR-CVS] cvs: pear /DB/DB dbase.php fbsql.php ibase.php ifx.php msql.php mssql.php mysql.php mysql4.php oci8.php odbc.php pgsql.php sqlite.php
sybase.php
| From: | Lukas Smith | Date: | Sun, 04 Jan 2004 21:46:56 +0000 |
| Subject: | RE: [PEAR-CVS] cvs: pear /DB/DB dbase.php fbsql.php ibase.php ifx.php msql.php mssql.php mysql.php mysql4.php oci8.php odbc.php pgsql.php sqlite.php sybase.php |
||
| References: | 1 | Groups: | php.pear.qa |
| Request: | Send a blank email to pear-qa+get-330@lists.php.net to get a copy of this message | ||
> From: Daniel Convissor [mailto:danielc@analysisandsolutions.com]
> On Sat, Jan 03, 2004 at 01:26:28PM +0800, Alan Knowles wrote:
> > Daniel Convissor wrote:
> > a) making portibility a depreciated option
>
> Do you envision some other option taking its place in order to provide
> portability? I mean, the primary point -- at least for me -- of using DB
> is the ability to change DBMS's without having to change my application.
> Heck, if I didn't care about portability, I wouldn't even bother with the
> overhead of DB and would go with the direct db specific functions.
Well alot of people use DB just for having a unified API across all RDBMS.
Some others use it because they like to have an OO interface. Others use it
because they are using other packages that use DB. Then others use it for
the error handling.
Anyways I wouldn't call portability the primary goal of DB really. To me the
focus always seemed at proving a common OO API across all RDBMS.
So development on DB has to take into account all of these varied user
interests and balance them.
> > >The point of quote() is to make a variable safe for insertion into a
> > >query.
> >
> > Not acording to the docs "DB_Common::quote() -- quotes a string"
>
> Aw, come on now... don't forget the description :)
> "Quotes a string database-dependent, so it can be safely used in a query."
> Perhaps we have different interpretations of what that means?
Well I would go with Alans intepretation as well :-)
>
> > One of the main failings of using PHP types to determine quoting is
> > quoting should be dependant on the field type in the databases (not the
> > PHP type)
>
> True. But in coding your application, you ensure the PHP type is what the
> column type is supposed to be, which is what several drivers (most
> importantly, the MySQL driver) already did.
>
>
> > Options
> > b) Fix magic & add method simpleQuote
> > + at least behaviour is consistant.
> > + reasonably BC
> > - method name / documentation not perfect..
> >
> > b) looks like the best option here.
>
> Yes, of the options presented. Two "of course..." statements, though.
> First, thought the docs aren't perfect now, that will be rectified.
> Second, there's the option of continuing the way things are now.
>
> All that aside, what do you envision a new simpleQuote method doing?
Sounds like he is proposing a magic free quote() for this.
I prefer the path of adding a smartQuote() which has all the magic, and
leave the current quote() magic (1.5.RC2) in there.
Regards,
Lukas