<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Api\SchemaController;

Route::get('/user', function (Request $request) {
    return $request->user();
})->middleware('auth:sanctum');

Route::prefix('schema')->group(function () {
    Route::get('/databases', [SchemaController::class, 'databases']);
    Route::get('/tables/{database}', [SchemaController::class, 'tables']);
    Route::get('/{table}', [SchemaController::class, 'schema']);
});
