[wp-hackers] Google SoC: PostgreSQL port

Olexandr Melnyk omelnyk at gmail.com
Fri Mar 23 17:10:51 GMT 2007


2007/3/23, Juan Manuel Doren <jmdoren at ok.cl>:
>
> take a look on http://pear.php.net/package/MDB2
>
> i think is a good idea using some think like this
>
> function wp_select( $columns, $tables, $where, $order, $limit1, $limit2 )
>
>
> and there are two choices
>
> 1) include different files with functions
> switch( database_type()  )
> {
>     case ORACLE:
>     {
>         include ( 'oracle_functions.php' );
>
> ....
>
>
> 2)
>
> have a smart select function
>
> function wp_select( $columns, $tables, $where, $order, $limit1, $limit2 ){
>
> switch ( database_type() )
> {
>       case MYSQL:
>       case SOME_OTHER_DATABASE_LIKE_MYSQL
>        {
>            $query = sprintf( 'SELECT ............ )
>
> .....
>
>
>
> I think the second one is better, because the wp_select will be
> available for all
> the plugins
>
>
Good idea. I think, it would be the best to make WordPress use ActiveRecord
pattern, but it would need more time and effort.

Also, we will have to avoid using backticks for field names and single
quotes for strings everywhere, as these syntaxes are both
MySQL-special. There are some other simple rules to be followed, but
in general, it's sticking to ANSI syntax wherever possible.

-----------------------------------
Olexandr Melnyk


More information about the wp-hackers mailing list