<?php
require __DIR__ . '/../vendor/autoload.php';
$app = require __DIR__ . '/../bootstrap/app.php';
$app->make(\Illuminate\Contracts\Console\Kernel::class)->bootstrap();

$cols = \Illuminate\Support\Facades\DB::connection('legacy')->select('DESCRIBE users');
foreach ($cols as $c) {
    echo $c->Field . ' | ' . $c->Type . ' | null=' . $c->Null . ' | default=' . ($c->Default ?? 'NULL') . PHP_EOL;
}

echo PHP_EOL . '-- Sample row --' . PHP_EOL;
$row = \Illuminate\Support\Facades\DB::connection('legacy')->table('users')->where('user_id', 53000)->first();
if ($row) {
    foreach ((array)$row as $k => $v) {
        echo $k . ': ' . $v . PHP_EOL;
    }
}
