Exemple #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);
     }
 }
Exemple #2
0
 /**
  * @covers Cradle\Sql\Sqlite::getUtilityQuery
  */
 public function testGetUtilityQuery()
 {
     $instance = $this->object->getUtilityQuery();
     $this->assertInstanceOf('Cradle\\Sql\\Sqlite\\QueryUtility', $instance);
 }