-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix SqlitePlatform to support quoted table name (#1025)
- Loading branch information
Showing
7 changed files
with
97 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Atk4\Data\Persistence\Sql\Sqlite; | ||
|
||
use Doctrine\DBAL\Schema\Identifier; | ||
|
||
trait PlatformTrait | ||
{ | ||
// fix quoted table name support | ||
// TODO submit a PR with fixed SqlitePlatform to DBAL | ||
|
||
private function unquoteTableIdentifier(string $tableName): string | ||
{ | ||
return (new Identifier($tableName))->getName(); | ||
} | ||
|
||
public function getListTableConstraintsSQL($table) | ||
{ | ||
return parent::getListTableConstraintsSQL($this->unquoteTableIdentifier($table)); | ||
} | ||
|
||
public function getListTableColumnsSQL($table, $database = null) | ||
{ | ||
return parent::getListTableColumnsSQL($this->unquoteTableIdentifier($table), $database); | ||
} | ||
|
||
public function getListTableIndexesSQL($table, $database = null) | ||
{ | ||
return parent::getListTableIndexesSQL($this->unquoteTableIdentifier($table), $database); | ||
} | ||
|
||
public function getListTableForeignKeysSQL($table, $database = null) | ||
{ | ||
return parent::getListTableForeignKeysSQL($this->unquoteTableIdentifier($table), $database); | ||
} | ||
} |
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