feat: implement MySQL driver for database management, schema discovery, and CRUD operations

This commit is contained in:
Ümit Tunç
2026-04-24 13:14:34 +03:00
parent e7ecf6cba1
commit 5d3afeadf2
6 changed files with 392 additions and 208 deletions
@@ -265,6 +265,18 @@ class MySqlDriver implements DatabaseDriverInterface, SchemaDiscoveryInterface
return true;
}
public function dropTable(string $table): bool
{
DB::connection($this->connectionName)->statement("DROP TABLE `{$table}`");
return true;
}
public function optimizeTable(string $table): bool
{
DB::connection($this->connectionName)->statement("OPTIMIZE TABLE `{$table}`");
return true;
}
public function getTablesMetadata(string $database): array
{
$sql = "
+10
View File
@@ -139,6 +139,16 @@ class DatabaseService
return $this->getDriver()->truncateTable($table);
}
public function dropTable(string $table): bool
{
return $this->getDriver()->dropTable($table);
}
public function optimizeTable(string $table): bool
{
return $this->getDriver()->optimizeTable($table);
}
/**
* Get metadata for all tables in a database.
*/