This is a backport of the Drupal 7 PDO database compatibility layer for use with Drupal 6 modules.

It is named after the original issue by Larry "Crell" Garfield titled Database Layer: The Next Generation.

Functionality

You should only install this module if another module instructs you to, as this module does not provide any end-user functionality.

This module does not override the existing database functionality but makes the new compatibility layer available under a series of functions identical to their Drupal 7 counterparts named dbtng_ instead of db_. For example with this module, use dbtng_set_active instead of db_set_active, with the exception of the following functions that funciton identically to their Drupal 7 conterparts: db_insert, db_merge, db_update, db_delete, db_truncate, db_select, db_transaction, db_close, db_condition, db_xor, db_and, db_or, db_next_id, and db_like.

Most code should be able to use the primary query building functions listed above without modification in both Drupal 6 and Drupal 7.

Features

This module allows Drupal to connect to multiple types of databases at the same time. While Drupal 6 supports multiple types of databases and multiple connections, it can only connect to 1 type at a time. This module allows different types to be active at the same time.

For documentation see api.drupal.org and the handbook pages.

Warnings

This module is should be used cautiously as it cannot share the database connection that is initiated by the mysql, mysqli, or postgres extensions that Drupal 6 uses. This means that a page or module on your site that uses DBTNG to query the primary database will cause double the number of database connections to be opened for each request.

Requirements

Versions of DBTNG prior to 6.x-1.0-rc4 require Autoload 6.x-2.0 or higher.

Project Information

Downloads