feat: define SchemaDiscoveryInterface for database schema inspection
This commit is contained in:
@@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Contracts;
|
||||||
|
|
||||||
|
interface SchemaDiscoveryInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* List all databases.
|
||||||
|
*/
|
||||||
|
public function getDatabases(): array;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List all tables in the current database.
|
||||||
|
*/
|
||||||
|
public function getTables(): array;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the schema of a specific table.
|
||||||
|
*/
|
||||||
|
public function getTableSchema(string $table): array;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get foreign keys for a table.
|
||||||
|
*/
|
||||||
|
public function getForeignKeys(string $table): array;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user