| @@ 1096-1111 (lines=16) @@ | ||
| 1093 | * @param string $tableName Table name |
|
| 1094 | * @return array |
|
| 1095 | */ |
|
| 1096 | public function describeTable($tableName) |
|
| 1097 | { |
|
| 1098 | $options = $this->getOptions(); |
|
| 1099 | ||
| 1100 | // mysql specific |
|
| 1101 | $sql = sprintf( |
|
| 1102 | "SELECT * |
|
| 1103 | FROM information_schema.tables |
|
| 1104 | WHERE table_schema = '%s' |
|
| 1105 | AND table_name = '%s'", |
|
| 1106 | $options['name'], |
|
| 1107 | $tableName |
|
| 1108 | ); |
|
| 1109 | ||
| 1110 | return $this->fetchRow($sql); |
|
| 1111 | } |
|
| 1112 | ||
| 1113 | /** |
|
| 1114 | * Returns MySQL column types (inherited and MySQL specified). |
|
| @@ 188-201 (lines=14) @@ | ||
| 185 | /** |
|
| 186 | * {@inheritdoc} |
|
| 187 | */ |
|
| 188 | public function hasTable($tableName) |
|
| 189 | { |
|
| 190 | $options = $this->getOptions(); |
|
| 191 | ||
| 192 | $exists = $this->fetchRow(sprintf( |
|
| 193 | "SELECT TABLE_NAME |
|
| 194 | FROM INFORMATION_SCHEMA.TABLES |
|
| 195 | WHERE TABLE_SCHEMA = '%s' AND TABLE_NAME = '%s'", |
|
| 196 | $options['name'], |
|
| 197 | $tableName |
|
| 198 | )); |
|
| 199 | ||
| 200 | return !empty($exists); |
|
| 201 | } |
|
| 202 | ||
| 203 | /** |
|
| 204 | * {@inheritdoc} |
|