Code Duplication    Length = 13-15 lines in 3 locations

src/MySql/DataLayer.php 3 locations

@@ 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
  /**
@@ 361-373 (lines=13) @@
358
   *
359
   * @return \array[]
360
   */
361
  public static function getTableTriggers($schemaName, $tableName)
362
  {
363
    $sql = sprintf('
364
select Trigger_Name as trigger_name
365
from   information_schema.TRIGGERS
366
where  TRIGGER_SCHEMA     = %s
367
and    EVENT_OBJECT_TABLE = %s
368
order by Trigger_Name',
369
                   self::$dl->quoteString($schemaName),
370
                   self::$dl->quoteString($tableName));
371
372
    return self::$dl->executeRows($sql);
373
  }
374
375
  //--------------------------------------------------------------------------------------------------------------------
376
  /**