예제 #1
0
 protected function queryTables(PDO $pdo, Schema $schema, $tables = null)
 {
     $parameters = [];
     $conditions = $this->sqlIn($parameters, 'name', $tables);
     $results = $this->executeSelectQuery($pdo, "SELECT \n\t\t\t\tname\n\t\t\tFROM " . $pdo->quote($schema->getName()) . ".sqlite_master \n\t\t\tWHERE \n\t\t\t\ttype='table' AND \n\t\t\t\tname NOT LIKE 'sqlite\\_%' ESCAPE '\\' AND\n\t\t\t\t{$conditions}\n\t\t\tORDER BY name ASC", $parameters);
     return array_map(function ($result) use($schema) {
         return array_merge($result, ['characterSet' => $schema->getCharacterSet()]);
     }, $results);
 }
예제 #2
0
 protected function queryTables(PDO $pdo, Schema $schema, $tables = null)
 {
     $parameters = [$schema->getName()];
     $conditions = $this->sqlIn($parameters, '`TABLE_NAME`', $tables);
     return $this->executeSelectQuery($pdo, "SELECT \n\t\t\t\t`TABLE_NAME` AS `name`,\n\t\t\t\t`ENGINE` AS `engine`,\n\t\t\t\t`CHARACTER_SET_NAME` AS `characterSet`,\n\t\t\t\t`TABLE_COLLATION` AS `collation`,\n\t\t\t\t`TABLE_COMMENT` AS `comment`\n\t\t\tFROM `INFORMATION_SCHEMA`.`TABLES`\n\t\t\tLEFT JOIN `INFORMATION_SCHEMA`.`COLLATION_CHARACTER_SET_APPLICABILITY` ON \n\t\t\t\t`TABLES`.`TABLE_COLLATION` = `COLLATION_CHARACTER_SET_APPLICABILITY`.`COLLATION_NAME`\n\t\t\tWHERE `TABLE_TYPE` = 'BASE TABLE' AND `TABLE_SCHEMA` = ? AND {$conditions}\n\t\t\tORDER BY `TABLE_NAME` ASC", $parameters);
 }
예제 #3
0
 protected function newTable(Schema $schema, array $attributes = [])
 {
     return $schema->newTable($attributes);
 }