| @@ 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). |
|
| @@ 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} |
|