-
Notifications
You must be signed in to change notification settings - Fork 61
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
Error when using Sqlite #304
Comments
hmm this is interesting .. might be a BC break in Doctrine 2.5? @Ocramius do you have an idea why he is not getting an instance of PDOConnection from Doctrine DBAL but a raw PDO object? Hmm I guess the reason is that Laravel is setting the PDO connection as a parameter maybe? @andylibrian can you make the change to |
Any git changelogs for that type hint? I don't remember this changing since 2.4.x |
@lsmith77 I just sent the PR and it seems like the test suite still passes. I felt determined so I toke a look at Doctrine DBAL and found this, what do you guys think about it? The error from jackalope was because // @TODO: move to "SqlitePlatform" and rename to "registerExtraFunctions"?
if ($this->conn->getDatabasePlatform() instanceof SqlitePlatform) {
$this->registerSqliteFunctions($this->conn->getWrappedConnection());
} in Doctrine\DBAL\Connection::getWrappedConnection() /**
* Gets the wrapped driver connection.
*
* @return \Doctrine\DBAL\Driver\Connection
*/
public function getWrappedConnection()
{
$this->connect();
return $this->_conn;
} It says it should return public function __construct(array $params, Driver $driver, Configuration $config = null,
EventManager $eventManager = null)
{
$this->_driver = $driver;
$this->_params = $params;
if (isset($params['pdo'])) {
$this->_conn = $params['pdo'];
$this->_isConnected = true;
unset($this->_params['pdo']);
}
That might be the case? In my Laravel package, I indeed reuse the existing PDO connection (from Laravel Service Provider) and pass it to Doctrine DBAL as 'pdo' param. |
This TODO is a reminder to clean up those "if PLATFORM then" cascades. Not related to this issue. |
so there is some regression in dbal it seems. but we do need a method from PDO actually in that place. commented on the pull request. @andylibrian great that you build a laravel module, by the way! once it is working, please do a PR to the https://github.com/phpcr/phpcr.github.io/ so that we list the module in the integrations section of the website! |
#306 has been merged and is included in the latest stable tag. is there anything left to do here? @andylibrian did you get around to create that laravel module? |
I am writing a Laravel package that wraps jackalope doctrine dbal.
In my test, I use pdo sqlite driver, and the test failed with following error:
Here is the build : https://travis-ci.org/ramping/laravel-jackalope-doctrine-dbal/jobs/86153727
Apparently, it's because of this:
After I read these lines:
I tried to change it to
Then the test passed. Any idea?
Is this something related to that "TODO"?
The text was updated successfully, but these errors were encountered: