| @@ 187-200 (lines=14) @@ | ||
| 184 | /** |
|
| 185 | * {@inheritdoc} |
|
| 186 | */ |
|
| 187 | public function hasTable($tableName) |
|
| 188 | { |
|
| 189 | $options = $this->getOptions(); |
|
| 190 | ||
| 191 | $exists = $this->fetchRow(sprintf( |
|
| 192 | "SELECT TABLE_NAME |
|
| 193 | FROM INFORMATION_SCHEMA.TABLES |
|
| 194 | WHERE TABLE_SCHEMA = '%s' AND TABLE_NAME = '%s'", |
|
| 195 | $options['name'], |
|
| 196 | $tableName |
|
| 197 | )); |
|
| 198 | ||
| 199 | return !empty($exists); |
|
| 200 | } |
|
| 201 | ||
| 202 | /** |
|
| 203 | * {@inheritdoc} |
|
| @@ 1081-1096 (lines=16) @@ | ||
| 1078 | * @param string $tableName Table name |
|
| 1079 | * @return array |
|
| 1080 | */ |
|
| 1081 | public function describeTable($tableName) |
|
| 1082 | { |
|
| 1083 | $options = $this->getOptions(); |
|
| 1084 | ||
| 1085 | // mysql specific |
|
| 1086 | $sql = sprintf( |
|
| 1087 | "SELECT * |
|
| 1088 | FROM information_schema.tables |
|
| 1089 | WHERE table_schema = '%s' |
|
| 1090 | AND table_name = '%s'", |
|
| 1091 | $options['name'], |
|
| 1092 | $tableName |
|
| 1093 | ); |
|
| 1094 | ||
| 1095 | return $this->fetchRow($sql); |
|
| 1096 | } |
|
| 1097 | ||
| 1098 | /** |
|
| 1099 | * Returns MySQL column types (inherited and MySQL specified). |
|