crate / crate-pdo

CrateDB PHP PDO adapter
https://crate.io/docs/pdo/
Apache License 2.0
33 stars 19 forks source link

PDO::PARAM_STR - This is not supported, please use prepared statements. #87

Open olavski opened 6 years ago

olavski commented 6 years ago

I'm using Crate with the Laravel Eloquent ORM and I'm having problems PDO::PARAM_STR. For now I replaced

throw new Exception\UnsupportedException('This is not supported, please use prepared statements.');

with:

return str_replace( "'", "''", $string );

And that seemed to work for my current use case.

Is there a way to fully support PDO::PARAM_STR?

Cheers!

seut commented 5 years ago

@olavski Sorry for our late response, this slipped through somehow. Afaik you're talking about the PDO->quote() method, right?

Can you elaborate a bit more why you need this method to be implemented properly (why it should support PDO::PARAM_STR)?

olavski commented 5 years ago

Thanks for looking into this!

If I remember correctly this error came up using a 3rd party package (Laravel Debugbar) with Laravel (https://github.com/RatkoR/laravel-crate.io).

The package would mainly used with MySQL/Postgres and would not have been tested with CrateDB. I'm using a modified version of crate-pdo to get it working: https://github.com/web64/crate-pdo/blob/master/src/Crate/PDO/PDO.php#L447

Also see: https://github.com/RatkoR/laravel-crate.io/issues/2

Cheers!