| @@ 190-203 (lines=14) @@ | ||
| 187 | /** |
|
| 188 | * {@inheritdoc} |
|
| 189 | */ |
|
| 190 | public function hasTable($tableName) |
|
| 191 | { |
|
| 192 | $options = $this->getOptions(); |
|
| 193 | ||
| 194 | $exists = $this->fetchRow(sprintf( |
|
| 195 | "SELECT TABLE_NAME |
|
| 196 | FROM INFORMATION_SCHEMA.TABLES |
|
| 197 | WHERE TABLE_SCHEMA = '%s' AND TABLE_NAME = '%s'", |
|
| 198 | $options['name'], |
|
| 199 | $tableName |
|
| 200 | )); |
|
| 201 | ||
| 202 | return !empty($exists); |
|
| 203 | } |
|
| 204 | ||
| 205 | /** |
|
| 206 | * {@inheritdoc} |
|
| @@ 1229-1244 (lines=16) @@ | ||
| 1226 | * @param string $tableName Table name |
|
| 1227 | * @return array |
|
| 1228 | */ |
|
| 1229 | public function describeTable($tableName) |
|
| 1230 | { |
|
| 1231 | $options = $this->getOptions(); |
|
| 1232 | ||
| 1233 | // mysql specific |
|
| 1234 | $sql = sprintf( |
|
| 1235 | "SELECT * |
|
| 1236 | FROM information_schema.tables |
|
| 1237 | WHERE table_schema = '%s' |
|
| 1238 | AND table_name = '%s'", |
|
| 1239 | $options['name'], |
|
| 1240 | $tableName |
|
| 1241 | ); |
|
| 1242 | ||
| 1243 | return $this->fetchRow($sql); |
|
| 1244 | } |
|
| 1245 | ||
| 1246 | /** |
|
| 1247 | * Returns MySQL column types (inherited and MySQL specified). |
|