|
@@ 254-267 (lines=14) @@
|
| 251 |
|
* |
| 252 |
|
* @return \array[] |
| 253 |
|
*/ |
| 254 |
|
public static function getTableColumns($schemaName, $tableName) |
| 255 |
|
{ |
| 256 |
|
$sql = sprintf(' |
| 257 |
|
select COLUMN_NAME as column_name |
| 258 |
|
, COLUMN_TYPE as column_type |
| 259 |
|
, IS_NULLABLE as is_nullable |
| 260 |
|
, CHARACTER_SET_NAME as character_set_name |
| 261 |
|
, COLLATION_NAME as collation_name |
| 262 |
|
from information_schema.COLUMNS |
| 263 |
|
where TABLE_SCHEMA = %s |
| 264 |
|
and TABLE_NAME = %s |
| 265 |
|
order by ORDINAL_POSITION', |
| 266 |
|
self::$dl->quoteString($schemaName), |
| 267 |
|
self::$dl->quoteString($tableName)); |
| 268 |
|
|
| 269 |
|
return self::$dl->executeRows($sql); |
| 270 |
|
} |
|
@@ 281-295 (lines=15) @@
|
| 278 |
|
* |
| 279 |
|
* @return array |
| 280 |
|
*/ |
| 281 |
|
public static function getTableOptions($schemaName, $tableName) |
| 282 |
|
{ |
| 283 |
|
$sql = sprintf(' |
| 284 |
|
SELECT t1.TABLE_COLLATION as table_collation |
| 285 |
|
, t1.ENGINE as engine |
| 286 |
|
, t2.CHARACTER_SET_NAME as character_set_name |
| 287 |
|
FROM information_schema.TABLES t1 |
| 288 |
|
inner join information_schema.COLLATION_CHARACTER_SET_APPLICABILITY t2 on t2.COLLATION_NAME = t1.TABLE_COLLATION |
| 289 |
|
WHERE t1.TABLE_SCHEMA = %s |
| 290 |
|
AND t1.TABLE_NAME = %s', |
| 291 |
|
self::$dl->quoteString($schemaName), |
| 292 |
|
self::$dl->quoteString($tableName)); |
| 293 |
|
|
| 294 |
|
return self::$dl->executeRow1($sql); |
| 295 |
|
} |
| 296 |
|
|
| 297 |
|
//-------------------------------------------------------------------------------------------------------------------- |
| 298 |
|
/** |
|
@@ 348-360 (lines=13) @@
|
| 345 |
|
* |
| 346 |
|
* @return \array[] |
| 347 |
|
*/ |
| 348 |
|
public static function getTableTriggers($schemaName, $tableName) |
| 349 |
|
{ |
| 350 |
|
$sql = sprintf(' |
| 351 |
|
select Trigger_Name as trigger_name |
| 352 |
|
from information_schema.TRIGGERS |
| 353 |
|
where TRIGGER_SCHEMA = %s |
| 354 |
|
and EVENT_OBJECT_TABLE = %s |
| 355 |
|
order by Trigger_Name', |
| 356 |
|
self::$dl->quoteString($schemaName), |
| 357 |
|
self::$dl->quoteString($tableName)); |
| 358 |
|
|
| 359 |
|
return self::$dl->executeRows($sql); |
| 360 |
|
} |
| 361 |
|
|
| 362 |
|
//-------------------------------------------------------------------------------------------------------------------- |
| 363 |
|
/** |