[wpmu-trac] [WordPress MU Trac] #1191: Microsoft SQL Server Support

WordPress MU Trac wpmu-trac at lists.automattic.com
Wed Jan 13 22:31:23 UTC 2010


#1191: Microsoft SQL Server Support
-------------------------+--------------------------------------------------
 Reporter:  agentile     |       Owner:  somebody
     Type:  enhancement  |      Status:  new     
 Priority:  normal       |   Milestone:          
Component:  component1   |     Version:          
 Severity:  normal       |    Keywords:  Database
-------------------------+--------------------------------------------------
 http://core.trac.wordpress.org/ticket/10918

 In reference to the above, I would like to submit a WPMU version of the
 same patch.

 ---

 For a long time, many have asked for WordPress to support other database
 types. Of course, this causes some issues, as it is difficult to implement
 database abstraction within WordPress using a conventional method like PDO
 (because PDO lacks PHP4 support). It would also mean restructuring queries
 to be more generic, which would compromise the MySQL optimizations
 WordPress has implemented. Finally, it would be a huge undertaking and
 would affect a lot of the core WordPress code.

 This patch solves the database abstraction request by using SQL dialect
 translations, and provides support for the MS-SQL dialect. Taking this
 approach means there are no changes to queries or function calls in the
 WordPress codebase. WordPress developers and plugin developers do not have
 to keep track of the database backend. They can write their queries for
 MySQL, since that's the official WordPress database, and not have to think
 about it after that.

 Starting with the WordPress recommendation of creating a wpdb database
 class for the database type in question, we have created a structure for
 database abstraction within WordPress, with only minimal changes to the
 current code (more info in readme.txt). The new wpdb class and its support
 classes provide support for MS-SQL by translating on-the-fly from MySQL to
 MS-SQL. While it's likely not optimal for MS-SQL, it does not affect MySQL
 optimized queries at all.

 The translation system supports all SELECT, INSERT, UPDATE, DELETE,
 CREATE, ALTER, etc. queries, whether issued by WordPress or by a plugin.
 It also maps column types on-the-fly and caches them as needed. Any other
 queries that require translations will have it readily available. This way
 the mapping array should not require constant maintenance with changes to
 the WP core schema. Likewise, any installed plugins that create tables
 will update the mapping array as well, which in turn will handle any
 translation issues for that plugin.

 One corollary benefit is that others might contribute the necessary wpdb
 db class, schema, and translations for other popular databases using this
 initial MS-SQL implementation as an example. Of course, that's up to the
 community.

 We hope the attached patches meet with approval.

-- 
Ticket URL: <http://trac.mu.wordpress.org/ticket/1191>
WordPress MU Trac <http://mu.wordpress.org/>
WordPress Multiuser


More information about the wpmu-trac mailing list