-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: Fix dependencies * fix: Remove use of collections in favor of native array methods * feat: Introduce abstract Schema class for extending * fix: Update error message when using unsupport connection. Use UnsupportSchema as fallback schema. Co-authored-by: Owen Conti <[email protected]>
- Loading branch information
1 parent
6bd7864
commit 6bb9803
Showing
9 changed files
with
77 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
namespace OhSeeSoftware\LaravelSchemaList\Schemas; | ||
|
||
use Illuminate\Database\ConnectionInterface; | ||
use LogicException; | ||
|
||
abstract class Schema implements SchemaContract | ||
{ | ||
/** @var \Illuminate\Database\ConnectionInterface */ | ||
protected $connection; | ||
|
||
public function __construct(ConnectionInterface $connection) | ||
{ | ||
$this->connection = $connection; | ||
} | ||
|
||
public function getTables(): array | ||
{ | ||
throw new LogicException('This database driver does not support listing schema tables.'); | ||
} | ||
|
||
public function getColumns(string $table): array | ||
{ | ||
throw new LogicException('This database driver does not support listing columns of a table.'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
namespace OhSeeSoftware\LaravelSchemaList\Schemas; | ||
|
||
class UnsupportedSchema extends Schema | ||
{ | ||
} |