| @@ 186-199 (lines=14) @@ | ||
| 183 | /** |
|
| 184 | * {@inheritdoc} |
|
| 185 | */ |
|
| 186 | public function hasTable( $tableName ) { |
|
| 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} |
|
| 202 | */ |
|
| @@ 1072-1087 (lines=16) @@ | ||
| 1069 | * |
|
| 1070 | * @return array |
|
| 1071 | */ |
|
| 1072 | public function describeTable( $tableName ) { |
|
| 1073 | $options = $this->getOptions(); |
|
| 1074 | ||
| 1075 | // mysql specific |
|
| 1076 | $sql = sprintf( |
|
| 1077 | "SELECT * |
|
| 1078 | FROM information_schema.tables |
|
| 1079 | WHERE table_schema = '%s' |
|
| 1080 | AND table_name = '%s'", |
|
| 1081 | $options['name'], |
|
| 1082 | $tableName |
|
| 1083 | ); |
|
| 1084 | ||
| 1085 | return $this->fetchRow( $sql ); |
|
| 1086 | } |
|
| 1087 | ||
| 1088 | /** |
|
| 1089 | * Returns MySQL column types (inherited and MySQL specified). |
|
| 1090 | * @return array |
|