Inheritance: extends Ruckusing_Adapter_Base, implements Ruckusing_Adapter_Interface
 public function test_generate_table_without_primary_key()
 {
     $tableDefinition = new Ruckusing_Adapter_Sqlite3_TableDefinition($this->adapter, "users", array('id' => false));
     $tableDefinition->column("first_name", "string");
     $tableDefinition->column("last_name", "string", array('limit' => 32));
     $tableDefinition->finish();
     $column = $this->adapter->column_info("users", "id");
     $this->assertEquals(array(), $column);
     $primary_keys = $this->adapter->primary_keys('users');
     $this->assertEquals(array(), $primary_keys);
 }
 /**
  * @return string
  */
 private function keys()
 {
     if (count($this->_primary_keys) > 0) {
         $lead = ' PRIMARY KEY (';
         $quoted = array();
         foreach ($this->_primary_keys as $key) {
             $quoted[] = sprintf("%s", $this->_adapter->identifier($key));
         }
         $primary_key_sql = ",\n" . $lead . implode(",", $quoted) . ")";
         return $primary_key_sql;
     } else {
         return '';
     }
 }
Beispiel #3
0
 /**
  * Quote a string
  *
  * @param string $str the string to quote
  *
  * @return string
  */
 public function quote_string($str)
 {
     return $this->_adapter->quote_string($str);
 }