<?php
$pdo = new PDO('mysql:host=localhost;dbname=webgis_baru;charset=utf8', 'root', '');
$tablesStmt = $pdo->query("SHOW TABLES");
$tables = $tablesStmt->fetchAll(PDO::FETCH_COLUMN);

$schema = [];
foreach ($tables as $table) {
    $stmt = $pdo->query("DESCRIBE $table");
    $schema[$table] = $stmt->fetchAll(PDO::FETCH_ASSOC);
}

echo json_encode($schema, JSON_PRETTY_PRINT);
