SQL Console

SuperAdmin فقط • بدون migrations • History في ملف
{{-- رسالة نجاح --}} @if(session('ok'))
{{ session('ok') }}
@endif {{-- Logout --}}
@csrf
{{-- Main --}}
@csrf
@error('sql')
{{ $message }}
@enderror
@if(!empty($historyItem) && empty($error) && (($meta['kind'] ?? '') === 'select')) Export CSV @endif
{{-- Meta --}} @if(!empty($meta))
Driver: {{ $meta['driver'] }} Kind: {{ $meta['kind'] }} Tx: {{ $meta['transaction'] ? 'ON' : 'OFF' }} Mode: {{ $meta['mode'] }} Time: {{ $meta['execution_ms'] }}ms @if(!is_null($meta['rows_count'])) Rows: {{ $meta['rows_count'] }} @endif @if(!is_null($meta['affected'])) Affected: {{ $meta['affected'] }} @endif
@endif {{-- Error --}} @if(!empty($error))
Error
{{ $error }}
@endif {{-- EXPLAIN --}} @if(!empty($explain))
EXPLAIN
@foreach(array_keys((array)$explain[0]) as $col) @endforeach @foreach($explain as $row) @foreach((array)$row as $cell) @endforeach @endforeach
{{ $col }}
{{ is_null($cell) ? 'NULL' : $cell }}
@endif {{-- Results --}} @if(!empty($result))
Result
@foreach(array_keys((array)$result[0]) as $col) @endforeach @foreach($result as $row) @foreach((array)$row as $cell) @endforeach @endforeach
{{ $col }}
{{ is_null($cell) ? 'NULL' : $cell }}
@elseif(!empty($meta) && (($meta['kind'] ?? '') === 'select') && empty($error))
Query executed successfully. No rows returned.
@endif
{{-- History --}}
History (آخر 30)
@csrf
@forelse($history as $h)
#{{ $h['id'] }} {{ $h['at'] }}
{{ ($h['success'] ?? false) ? 'OK' : 'ERR' }} {{ $h['meta']['execution_ms'] ?? '-' }}ms {{ $h['meta']['kind'] ?? '-' }}
{{ $h['sql'] ?? '' }}
@if(($h['meta']['kind'] ?? '') === 'select' && ($h['success'] ?? false)) Export CSV @endif
@if(!($h['success'] ?? true) && !empty($h['error']))
{{ $h['error'] }}
@endif
@empty
لا يوجد History بعد.
@endforelse