Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQLite—Schema::getCurrentDatabase() fails #58

Closed
barryhughes opened this issue Dec 22, 2019 · 1 comment
Closed

SQLite—Schema::getCurrentDatabase() fails #58

barryhughes opened this issue Dec 22, 2019 · 1 comment

Comments

@barryhughes
Copy link
Contributor

barryhughes commented Dec 22, 2019

Opis\Database\Schema\Compiler\SQLite::currentDatabase() is declared to return an array but returns a string, causing breakages.

This can be demonstrated with the following code:

use Opis\Database\Connection;
use Opis\Database\Database;

$database = new Database(new Connection('sqlite:/tmp/test.db'));
$database->schema()->hasTable('foo');

Relevant error:

PHP Fatal error:  Uncaught TypeError: Return value of Opis\Database\Schema\Compiler\SQLite::currentDatabase() must be of the type array, string returned in /project-path/vendor/opis/database/src/Schema/Compiler/SQLite.php:117

The Oracle, Postrge and SQL Server implementations all return an array so are not impacted, this is only an issue for SQLite. Relevant source:

barryhughes added a commit to barryhughes/database that referenced this issue Dec 22, 2019
@msarca
Copy link
Member

msarca commented Feb 3, 2020

Fixed in v4.1.1. Thanks.

@msarca msarca closed this as completed Feb 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants