Example #1
0
 public static function load(PDO $connection)
 {
     $name = $connection->getAttribute(PDO::ATTR_DRIVER_NAME);
     switch ($name) {
         case 'mysql':
             return MySql::loadPDO($connection);
         case 'pgsql':
             return PostGreSql::loadPDO($connection);
         case 'sqlite':
             return Sqlite::loadPDO($connection);
         default:
             throw SqlException::forUnknownPDO($name);
     }
 }
Example #2
0
 /**
  * @covers Cradle\Sql\PostGreSql::getUtilityQuery
  */
 public function testGetUtilityQuery()
 {
     $instance = $this->object->getUtilityQuery();
     $this->assertInstanceOf('Cradle\\Sql\\PostGreSql\\QueryUtility', $instance);
 }