| @@ 195-208 (lines=14) @@ | ||
| 192 | /** |
|
| 193 | * {@inheritdoc} |
|
| 194 | */ |
|
| 195 | public function hasTable($tableName) |
|
| 196 | { |
|
| 197 | $options = $this->getOptions(); |
|
| 198 | ||
| 199 | $exists = $this->fetchRow(sprintf( |
|
| 200 | "SELECT TABLE_NAME |
|
| 201 | FROM INFORMATION_SCHEMA.TABLES |
|
| 202 | WHERE TABLE_SCHEMA = '%s' AND TABLE_NAME = '%s'", |
|
| 203 | $options['name'], |
|
| 204 | $tableName |
|
| 205 | )); |
|
| 206 | ||
| 207 | return ! empty($exists); |
|
| 208 | } |
|
| 209 | ||
| 210 | /** |
|
| 211 | * {@inheritdoc} |
|
| @@ 1111-1126 (lines=16) @@ | ||
| 1108 | * |
|
| 1109 | * @return array |
|
| 1110 | */ |
|
| 1111 | public function describeTable($tableName) |
|
| 1112 | { |
|
| 1113 | $options = $this->getOptions(); |
|
| 1114 | ||
| 1115 | // mysql specific |
|
| 1116 | $sql = sprintf( |
|
| 1117 | "SELECT * |
|
| 1118 | FROM information_schema.tables |
|
| 1119 | WHERE table_schema = '%s' |
|
| 1120 | AND table_name = '%s'", |
|
| 1121 | $options['name'], |
|
| 1122 | $tableName |
|
| 1123 | ); |
|
| 1124 | ||
| 1125 | return $this->fetchRow($sql); |
|
| 1126 | } |
|
| 1127 | ||
| 1128 | /** |
|
| 1129 | * Returns MySQL column types (inherited and MySQL specified). |
|