Uploaded image for project: 'Doctrine DBAL'
  1. Doctrine DBAL
  2. DBAL-56

Ship a compatibility wrapper like MDB2

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-BETA4
    • Fix Version/s: 2.1
    • Component/s: Drivers
    • Labels:
      None

      Description

      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

        Activity

        Hide
        beberlei Benjamin Eberlei added a comment -

        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.

        Show
        beberlei Benjamin Eberlei added a comment - 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.

          People

          • Assignee:
            beberlei Benjamin Eberlei
            Reporter:
            beberlei Benjamin Eberlei
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: