src/DB/Connecter/MySQLConnecter.php
function getMetaData($table, $fields_map = true)
    {
        $data = $this->pdo->query("DESCRIBE {$table}");
        try {
            if ($fields_map) {
                $result = array();
                $data->fetchAll(PDO::FETCH_FUNC, function ($field, $type, $null, $key, $default, $extra) use (&$result) {
                    $result[$field] = array(
                        'primary' => $key == 'PRI',
                        'auto_increment' => $extra == 'auto_increment',
                        'default_value' => strval($default),
                        'not_null' => $null == 'NO',
                    );
                });
                return $result;
            } else {
                return $data->fetchAll(PDO::FETCH_ASSOC);
            }
        } catch (Exception $e) {
            return array();
        }
    }
function getMetaData($table, $fields_map = true)
    {
        $data = $this->pdo->query("DESCRIBE {$table}");
        try {
            if ($fields_map) {
                $result = array();
                $data->fetchAll(PDO::FETCH_FUNC, function ($field, $type, $null, $key, $default, $extra) use (&$result) {
                    $result[$field] = array(
                        'primary' => $key == 'PRI',
                        'auto_increment' => $extra == 'auto_increment',
                        'default_value' => strval($default),
                        'not_null' => $null == 'NO',
                    );
                });
                return $result;
            } else {
                return $data->fetchAll(PDO::FETCH_ASSOC);
            }
        } catch (Exception $e) {
            return array();
        }
    }
获取表的字段信息

@param string $table
@param bool $fields_map
@return mixed