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