protected function _fieldData(string
$table): array
{ $sql = 'SELECT "column_name", "data_type", "character_maximum_length", "numeric_precision", "column_default", "is_nullable"
FROM "information_schema"."columns"
WHERE LOWER("table_name") = '
.
$this->
escape(strtolower($table)) . ' ORDER BY "ordinal_position"';
if (($query =
$this->
query($sql)) === false
) { throw new DatabaseException(lang('Database.failGetFieldData'
));
} $query =
$query->
getResultObject();
$retVal =
[];
for ($i = 0,
$c =
count($query);
$i <
$c;
$i++
) { $retVal[$i] =
new stdClass();
$retVal[$i]->name =
$query[$i]->column_name;
$retVal[$i]->type =
$query[$i]->data_type;
$retVal[$i]->nullable =
$query[$i]->is_nullable === 'YES';
$retVal[$i]->default =
$query[$i]->column_default;
$retVal[$i]->max_length =
$query[$i]->character_maximum_length > 0 ?
$query[$i]->character_maximum_length :
$query[$i]->numeric_precision;
}