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