DBAL-56: Ship a compatibility wrapper like MDB2 #1769

Closed
doctrinebot opened this Issue Sep 29, 2010 · 2 comments

2 participants

@doctrinebot

Jira issue originally created by user @beberlei:

Database Portability is expensive but often necessary. We should support the important Compatibility Layer Options that MDB2 has:

http://pear.php.net/manual/en/package.database.mdb2.intro-portability.php

The following I think are doable:

  • Empty to Nulls
  • Change Case of Field-Assocs
  • Oracle RTRIM for Chars
  • Num Rows "hack" for Oracle (?)
  • Delete Count (Some vendors rewrite a DELETE tablename into a TRUNCATE and dont report the delete count)

There should be a class extending "Doctrine\DBAL\Connection" making use of the 'wrapperClass' option. Two new classes are necessary:

Doctrine\DBAL\Portability\Connection
Doctrine\DBAL\Portability\Statement

@doctrinebot

Comment created by @beberlei:

Implemented.

To use define the following three parameters:

$params = array();
// ...
$params['wrapperClass'] = 'Doctrine\DBAL\Portability\Connection';
$params['portability'] = Doctrine\DBAL\Portability\Connection::PORTABILITY_ALL;
$params['fetch*case'] = \PDO::CASE*LOWER;
$conn = DriverManager::getConnection($params, $config, $evm);

This mode probably hits performance pretty hard,but it allows you to write code that works with all the quirks of fetching values from all database vendors.

@doctrinebot

Issue was closed with resolution "Fixed"

@beberlei beberlei was assigned by doctrinebot Dec 6, 2015
@doctrinebot doctrinebot added this to the 2.1 milestone Dec 6, 2015
@doctrinebot doctrinebot closed this Dec 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment