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

Probably bindParameters bug #13

Closed
SerafimArts opened this issue Apr 13, 2019 · 5 comments
Closed

Probably bindParameters bug #13

SerafimArts opened this issue Apr 13, 2019 · 5 comments

Comments

@SerafimArts
Copy link
Contributor

SerafimArts commented Apr 13, 2019

ORM Version: 1.0.3

Code

$database = $ormFactory->database('example');
$database->execute('SHOW TABLES');

Expected

All OK

Actual

Argument 1 passed to Spiral\Database\Driver\Driver::bindParameters() must be an instance of Spiral\Database\Statement, instance of Doctrine\DBAL\Driver\PDOStatement given, called in .../vendor/spiral/database/src/Driver/Driver.php on line 275

image

I'm still trying to understand the cause of the problem. Maybe I'm doing something wrong =))))

@SerafimArts
Copy link
Contributor Author

SerafimArts commented Apr 13, 2019

Yes that's right. I tried to reuse the existing connection with another ORM, but missed this call: https://github.com/spiral/database/blob/master/src/Driver/Driver.php#L163

It seems necessary to create new PDO connections specifically for the Cycle ='(

@wolfy-j
Copy link
Contributor

wolfy-j commented Apr 13, 2019

Since PDO is stateful - yes. But I can try to make it happen.

@wolfy-j
Copy link
Contributor

wolfy-j commented Apr 13, 2019

Also, what are you looking can be changed. Statement extends PDO statement so it should be possible to fallback to lower level implementation.

@SerafimArts
Copy link
Contributor Author

SerafimArts commented Apr 13, 2019

But I can try to make it happen.

Not worth it, what I'm trying to combine difficult compatible things - these are not implementation problems

@wolfy-j
Copy link
Contributor

wolfy-j commented Jun 23, 2019

FYI, statement casting is not required anymore, you can share PDO between drivers I believe.

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