-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add exception if given connection has an unknown driver
- Loading branch information
Showing
5 changed files
with
88 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace CakeDumpSql\Error; | ||
|
||
class UnknownDriverException extends \Exception | ||
{ | ||
} |
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,44 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace TestApp\Driver; | ||
|
||
use Cake\Database\Driver; | ||
use Cake\Database\Driver\SqlDialectTrait; | ||
use Cake\Database\Schema\MysqlSchemaDialect; | ||
use Cake\Database\Schema\SchemaDialect; | ||
|
||
class MyDriver extends Driver | ||
{ | ||
use SqlDialectTrait; | ||
|
||
public function connect(): bool | ||
{ | ||
return true; | ||
} | ||
|
||
public function enabled(): bool | ||
{ | ||
return true; | ||
} | ||
|
||
public function schemaDialect(): SchemaDialect | ||
{ | ||
return new MysqlSchemaDialect($this); | ||
} | ||
|
||
public function disableForeignKeySQL(): string | ||
{ | ||
return ""; | ||
} | ||
|
||
public function enableForeignKeySQL(): string | ||
{ | ||
return ""; | ||
} | ||
|
||
public function supportsDynamicConstraints(): bool | ||
{ | ||
return true; | ||
} | ||
} |